summaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-11-13 13:45:40 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2013-11-13 13:45:40 +0100
commitede4cebce16f5643c61aedd6d88d9070a1d23a68 (patch)
treee5badf413ffaa9326f46597d065a88ba5f6c2cf7 /fs/dcache.c
parentfix unpaired rcu lock in prepend_path() (diff)
downloadlinux-ede4cebce16f5643c61aedd6d88d9070a1d23a68.tar.xz
linux-ede4cebce16f5643c61aedd6d88d9070a1d23a68.zip
prepend_path() needs to reinitialize dentry/vfsmount/mnt on restarts
... and equivalent is needed in 3.12; it's broken there as well Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to '')
-rw-r--r--fs/dcache.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index eacc853a2e3a..a9dd384c5e80 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2912,9 +2912,9 @@ static int prepend_path(const struct path *path,
const struct path *root,
char **buffer, int *buflen)
{
- struct dentry *dentry = path->dentry;
- struct vfsmount *vfsmnt = path->mnt;
- struct mount *mnt = real_mount(vfsmnt);
+ struct dentry *dentry;
+ struct vfsmount *vfsmnt;
+ struct mount *mnt;
int error = 0;
unsigned seq, m_seq = 0;
char *bptr;
@@ -2929,6 +2929,9 @@ restart:
bptr = *buffer;
blen = *buflen;
error = 0;
+ dentry = path->dentry;
+ vfsmnt = path->mnt;
+ mnt = real_mount(vfsmnt);
read_seqbegin_or_lock(&rename_lock, &seq);
while (dentry != root->dentry || vfsmnt != root->mnt) {
struct dentry * parent;