Whamcloud - gitweb
LU-271 Skip permission check for NFS open after create
authornasf <yong.fan@whamcloud.com>
Wed, 4 May 2011 13:43:11 +0000 (21:43 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 11 May 2011 23:30:52 +0000 (16:30 -0700)
For open_create operation, NFS client will trigger separate open RPC after create RPC.
We only need to check create permission for such case.

Change-Id: I7f0e2edb1b14f1044790180345f2c8328d92d4e8
Signed-off-by: nasf <yong.fan@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/494
Tested-by: Hudson
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
lustre/llite/file.c

index 5af347b..d316e18 100644 (file)
@@ -539,7 +539,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. */
                  * 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
                         oit.it_flags |= MDS_OPEN_OWNEROVERRIDE;
 
                 /* We do not want O_EXCL here, presumably we opened the file