Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

namei.c : update mnt when it needed

update the mnt of the path when it is not equal to the new one.

Signed-off-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

authored by

Huang Shijie and committed by
Al Viro
9a229683 51ee049e

+3 -2
+3 -2
fs/namei.c
··· 523 523 static inline void path_to_nameidata(struct path *path, struct nameidata *nd) 524 524 { 525 525 dput(nd->path.dentry); 526 - if (nd->path.mnt != path->mnt) 526 + if (nd->path.mnt != path->mnt) { 527 527 mntput(nd->path.mnt); 528 - nd->path.mnt = path->mnt; 528 + nd->path.mnt = path->mnt; 529 + } 529 530 nd->path.dentry = path->dentry; 530 531 } 531 532