Skip to contentSkip to conversation

namei.c: update mnt when it is needed

PATCH New [email protected] 1 participant 1 message Apr 27, 2010 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 7/7 namei.c: update mnt when it is needed

From: Huang Shijie <[email protected]>

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

---

 fs/namei.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
fs/namei.c renamed from fs/namei.c~nameic-update-mnt-when-it-needed +3 -2
diff -puN fs/namei.c~nameic-update-mnt-when-it-needed fs/namei.c
@@ -523,9 +523,10 @@ static void path_put_conditional(struct 
 static inline void path_to_nameidata(struct path *path, struct nameidata *nd)
 {
 	dput(nd->path.dentry);
-	if (nd->path.mnt != path->mnt)
+	if (nd->path.mnt != path->mnt) {
 		mntput(nd->path.mnt);
-	nd->path.mnt = path->mnt;
+		nd->path.mnt = path->mnt;
+	}
 	nd->path.dentry = path->dentry;
 }
 

_