From: Oleg Drokin Date: Tue, 6 Nov 2018 00:26:44 +0000 (-0500) Subject: LU-11623 llite: hash just created files if lock allows X-Git-Tag: 2.12.6-RC1~83 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7554658056cddae71fd90ef4a6dd639ddbe3f89b;p=fs%2Flustre-release.git LU-11623 llite: hash just created files if lock allows If open|creat (and other intent operations later) returned a lookup bit as part of the lock, hash the resultant dentry under this lock, not to trigger further RPCs in subsequent lookups. Lustre-change: https://review.whamcloud.com/33584 Lustre-commit: fc42cbe0e2e5d1d87d0edca73986b831ac718301 Signed-off-by: Lai Siyao Signed-off-by: Oleg Drokin Change-Id: Id5140d1042af7f5ab9052922e11a7eda8f92a29a Reviewed-on: https://review.whamcloud.com/38763 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 91e0026..ca455d5 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -665,9 +665,9 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request, if (bits & MDS_INODELOCK_LOOKUP) d_lustre_revalidate(*de); } else if (!it_disposition(it, DISP_OPEN_CREATE)) { - /* If file created on server, don't depend on parent UPDATE - * lock to unhide it. It is left hidden and next lookup can - * find it in ll_splice_alias. + /* + * If file was created on the server, the dentry is revalidated + * in ll_create_it if the lock allows for it. */ /* Check that parent has UPDATE lock. */ struct lookup_intent parent_it = { @@ -1148,6 +1148,7 @@ static int ll_create_it(struct inode *dir, struct dentry *dentry, void *secctx, __u32 secctxlen) { struct inode *inode; + __u64 bits = 0; int rc = 0; ENTRY; @@ -1183,6 +1184,10 @@ static int ll_create_it(struct inode *dir, struct dentry *dentry, RETURN(rc); } + ll_set_lock_data(ll_i2sbi(dir)->ll_md_exp, inode, it, &bits); + if (bits & MDS_INODELOCK_LOOKUP) + d_lustre_revalidate(dentry); + RETURN(0); }