Skip to contentSkip to conversation

namei.c : update mnt when it needed

PATCH RESEND In review Huang Shijie 2 participants 2 messages Apr 14, 2010 VFS

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 namei.c : update mnt when it needed

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

---
 fs/namei.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
fs/namei.c +3 -2
index a7dce91..9c3a040 100644
@@ -523,9 +523,10 @@ static void path_put_conditional(struct path *path, struct nameidata *nd)
 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;
 }
 
Signature · 1 line
1.6.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Huang Shijie

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

This change is trivial, and it looks fine for me.

Thanks!

Quoted 29 lines

---
fs/namei.c | 5 +++--

1 files changed, 3 insertions(+), 2 deletions(-)
fs/namei.c +3 -2
index a7dce91..9c3a040 100644
@@ -523,9 +523,10 @@ static void path_put_conditional(struct path *path, struct nameidata *nd)
 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;
 }
 
Signature · 7 lines
1.6.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/