]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
d_path: prepend_path(): lift resetting b in case when we'd return 3 out of loop
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 12 May 2021 20:21:43 +0000 (16:21 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 19 May 2021 00:15:56 +0000 (20:15 -0400)
preparation to extracting the loop into helper (next commit)

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

index 3836f5d0b0238fec4769135df78bf30ecc4829aa..9a0356cc98d3578ddcbb3cea5f65d8654585b9ba 100644 (file)
@@ -115,7 +115,6 @@ restart:
 
                        /* Escaped? */
                        if (dentry != mnt->mnt.mnt_root) {
-                               b = *p;
                                error = 3;
                                break;
                        }
@@ -156,6 +155,9 @@ restart:
        }
        done_seqretry(&mount_lock, m_seq);
 
+       if (unlikely(error == 3))
+               b = *p;
+
        if (b.len == p->len)
                prepend(&b, "/", 1);