From bca4755a572ee73065d54801bb2d07ad5e915dfe Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Wed, 12 Oct 2011 15:29:36 +0800 Subject: [PATCH] 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 --- lustre/llite/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 1.8.3.1