[CFR][PATCH] namei fixes (5/19)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(5/19)

fix for too early mntput() in open_namei() - we pin path.mnt down for the
duration of __do_follow_link().  Otherwise we could get the fs where our
symlink lived unmounted while we were in __do_follow_link().  That would
end up with dentry of symlink staying pinned down through the fs shutdown.

Signed-off-by: Al Viro <[email protected]>
----
diff -urN RC12-rc4-4/fs/namei.c RC12-rc4-5/fs/namei.c
--- RC12-rc4-4/fs/namei.c	2005-05-19 16:39:32.418043961 -0400
+++ RC12-rc4-5/fs/namei.c	2005-05-19 16:39:33.566815053 -0400
@@ -1524,8 +1524,10 @@
 	error = security_inode_follow_link(path.dentry, nd);
 	if (error)
 		goto exit_dput;
+	mntget(path.mnt);
 	error = __do_follow_link(path.dentry, nd);
 	dput(path.dentry);
+	mntput(path.mnt);
 	path.mnt = nd->mnt;
 	if (error)
 		return error;
-
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/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux