]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Nov 2013 19:27:51 +0000 (11:27 -0800)
commit ede4cebce16f5643c61aedd6d88d9070a1d23a68 upstream.

... and equivalent is needed in 3.12; it's broken there as well

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Reported-by: Michael Marineau <michael.marineau@coreos.com>
Tested-by: Waiman Long <Waiman.Long@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/dcache.c

index ae6ebb88ceff15ccef25f26804532d8b89cbe45a..89f96719a29b3ec9f74ff1102f361c0dea046b01 100644 (file)
@@ -2881,9 +2881,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 = 0;
        char *bptr;
@@ -2893,6 +2893,9 @@ static int prepend_path(const struct path *path,
 restart:
        bptr = *buffer;
        blen = *buflen;
+       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;