OpenVZ Forum


Home » Mailing lists » Devel » [patch 18/22] nfs: check mnt instead of superblock directly
[patch 18/22] nfs: check mnt instead of superblock directly [message #18818] 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>

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

---
 fs/nfs/dir.c  |    3 ++-
 fs/nfsd/vfs.c |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Index: 2.6.22-rc4-mm2-robindmount/fs/nfs/dir.c
===================================================================
--- 2.6.22-rc4-mm2-robindmount.orig/fs/nfs/dir.c
+++ 2.6.22-rc4-mm2-robindmount/fs/nfs/dir.c
@@ -998,7 +998,8 @@ static int is_atomic_open(struct inode *
 	if (nd->flags & LOOKUP_DIRECTORY)
 		return 0;
 	/* Are we trying to write to a read only partition? */
-	if (IS_RDONLY(dir) && (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
+	if (__mnt_is_readonly(nd->mnt) &&
+	    (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
 		return 0;
 	return 1;
 }
Index: 2.6.22-rc4-mm2-robindmount/fs/nfsd/vfs.c
===================================================================
--- 2.6.22-rc4-mm2-robindmount.orig/fs/nfsd/vfs.c
+++ 2.6.22-rc4-mm2-robindmount/fs/nfsd/vfs.c
@@ -1811,7 +1811,7 @@ nfsd_permission(struct svc_export *exp, 
 		inode->i_mode,
 		IS_IMMUTABLE(inode)?	" immut" : "",
 		IS_APPEND(inode)?	" append" : "",
-		IS_RDONLY(inode)?	" ro" : "");
+		__mnt_is_readonly(exp->mnt)?	" ro" : "");
 	dprintk("      owner %d/%d user %d/%d\n",
 		inode->i_uid, inode->i_gid, current->fsuid, current->fsgid);
 #endif
@@ -1822,7 +1822,7 @@ nfsd_permission(struct svc_export *exp, 
 	 */
 	if (!(acc & MAY_LOCAL_ACCESS))
 		if (acc & (MAY_WRITE | MAY_SATTR | MAY_TRUNC)) {
-			if (EX_RDONLY(exp) || IS_RDONLY(inode))
+			if (EX_RDONLY(exp) || __mnt_is_readonly(exp->mnt))
 				return nfserr_rofs;
 			if (/* (acc & MAY_WRITE) && */ IS_IMMUTABLE(inode))
 				return nfserr_perm;

-- 
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Previous Topic: [patch 17/22] elevate write count over calls to vfs_rename()
Next Topic: [patch 19/22] elevate writer count for do_sys_truncate()
Goto Forum:
  


Current Time: Tue Aug 26 21:58:50 GMT 2025

Total time taken to generate the page: 0.15419 seconds