From 2c00faec12ea60b8955fe0e793b32ef25795ed42 Mon Sep 17 00:00:00 2001 From: Lai Siyao Date: Fri, 16 Oct 2015 11:30:59 +0800 Subject: [PATCH] LU-7232 statahead: lock leaks if statahead file recreated During statahead file may be recreated, though this is rare case, current code will leak the lock, this patch will release lock in this case. Signed-off-by: Lai Siyao Change-Id: Ifc1fee0fe5a0f377badc3fdf6dc2a6950a26cff6 Reviewed-on: http://review.whamcloud.com/16841 Tested-by: Jenkins Reviewed-by: Fan Yong Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/llite/statahead.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lustre/llite/statahead.c b/lustre/llite/statahead.c index c7494cc..2fab1df 100644 --- a/lustre/llite/statahead.c +++ b/lustre/llite/statahead.c @@ -1467,8 +1467,10 @@ static int revalidate_statahead_dentry(struct inode *dir, struct dentry *alias; alias = ll_splice_alias(inode, *dentryp); - if (IS_ERR(alias)) + if (IS_ERR(alias)) { + ll_intent_release(&it); GOTO(out, rc = PTR_ERR(alias)); + } *dentryp = alias; /* statahead prepared this inode, transfer inode * refcount from sa_entry to dentry */ @@ -1485,6 +1487,7 @@ static int revalidate_statahead_dentry(struct inode *dir, (*dentryp)->d_name.name, PFID(ll_inode2fid((*dentryp)->d_inode)), PFID(ll_inode2fid(inode))); + ll_intent_release(&it); GOTO(out, rc = -ESTALE); } -- 1.8.3.1