From: Hongchao Zhang Date: Wed, 12 Oct 2011 07:29:36 +0000 (+0800) Subject: LU-754 Skip permission check for NFS open after create X-Git-Tag: 1.8.7-wc1~5 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=bca4755a572ee73065d54801bb2d07ad5e915dfe;p=fs%2Flustre-release.git LU-754 Skip permission check for NFS open after create 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 Reviewed-on: http://review.whamcloud.com/1509 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Johann Lombardi --- diff --git a/lustre/llite/file.c b/lustre/llite/file.c index ff9e06f..53c9f43 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -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