Whamcloud - gitweb
LU-754 Skip permission check for NFS open after create
authorHongchao Zhang <hongchao.zhang@whamcloud.com>
Wed, 12 Oct 2011 07:29:36 +0000 (15:29 +0800)
committerJohann Lombardi <johann@whamcloud.com>
Thu, 13 Oct 2011 20:23:40 +0000 (16:23 -0400)
For open(create) operation, NFS client will trigger separate open RPC request after create one,
then we only need to check permission for create operation in such case.

Change-Id: I958f190398305c3bcc1b1740e31c64855dc631e8
Signed-off-by: Hongchao Zhang <hongchao.zhang@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1509
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
lustre/llite/file.c

index ff9e06f..53c9f43 100644 (file)
@@ -457,7 +457,7 @@ int ll_file_open(struct inode *inode, struct file *file)
                  * dentry_open after call to open_namei that checks permissions.
                  * Only nfsd_open call dentry_open directly without checking
                  * permissions and because of that this code below is safe. */
-                if (oit.it_flags & FMODE_WRITE)
+                if (oit.it_flags & (FMODE_WRITE | FMODE_READ))
                         oit.it_flags |= MDS_OPEN_OWNEROVERRIDE;
 
                 /* We do not want O_EXCL here, presumably we opened the file