OpenVZ Forum


Home » Mailing lists » Devel » [patch 10/22] make access() use mnt check
[patch 10/22] make access() use mnt check [message #18810] Thu, 07 June 2007 15:25
Cedric Le Goater is currently offline  Cedric Le Goater
Messages: 443
Registered: February 2006
Senior Member
From: Dave Hansen <hansendc@us.ibm.com>

It is OK to let access() go without using a mnt_want/drop_write()
pair because it doesn't actually do writes to the filesystem,
and it is inherently racy anyway.  This is a rare case when it is
OK to use __mnt_is_readonly() directly.

Signed-off-by: Dave Hansen <hansendc@us.ibm.com>

---
 fs/open.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: 2.6.22-rc4-mm2-robindmount/fs/open.c
===================================================================
--- 2.6.22-rc4-mm2-robindmount.orig/fs/open.c
+++ 2.6.22-rc4-mm2-robindmount/fs/open.c
@@ -483,7 +483,7 @@ asmlinkage long sys_faccessat(int dfd, c
 	   special_file(nd.dentry->d_inode->i_mode))
 		goto out_path_release;
 
-	if(IS_RDONLY(nd.dentry->d_inode))
+	if(__mnt_is_readonly(nd.mnt))
 		res = -EROFS;
 
 out_path_release:

-- 
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
 
Read Message
Previous Topic: [patch 09/22] elevate writer count for chown and friends
Next Topic: [patch 11/22] elevate mnt writers for callers of vfs_mkdir()
Goto Forum:
  


Current Time: Mon Aug 25 00:10:57 GMT 2025

Total time taken to generate the page: 0.05438 seconds