prepend_path() needs to reinitialize dentry/vfsmount/mnt on restarts
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 13 Nov 2013 12:45:40 +0000 (07:45 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 13 Nov 2013 12:45:40 +0000 (07:45 -0500)
... and equivalent is needed in 3.12; it's broken there as well

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/dcache.c

index eacc853a2e3a64a3081a5cc0866d1e35a90979a7..a9dd384c5e8039e5707789128160600b6e4ed3e6 100644 (file)
@@ -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;