From: Lai Siyao Date: Thu, 10 Nov 2016 17:30:51 +0000 (-0500) Subject: staging: lustre: statahead: lock leaks if statahead file recreated X-Git-Tag: v4.10-rc1~148^2~267 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e8b237227b15113f9a4f4a93ec5850acb8d5a444;p=karo-tx-linux.git staging: lustre: 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 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7232 Reviewed-on: http://review.whamcloud.com/16841 Reviewed-by: Fan Yong Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c index 0677513476ec..b43955f097ab 100644 --- a/drivers/staging/lustre/lustre/llite/statahead.c +++ b/drivers/staging/lustre/lustre/llite/statahead.c @@ -1475,6 +1475,7 @@ static int revalidate_statahead_dentry(struct inode *dir, alias = ll_splice_alias(inode, *dentryp); if (IS_ERR(alias)) { + ll_intent_release(&it); rc = PTR_ERR(alias); goto out_unplug; } @@ -1493,6 +1494,7 @@ static int revalidate_statahead_dentry(struct inode *dir, *dentryp, PFID(ll_inode2fid((*dentryp)->d_inode)), PFID(ll_inode2fid(inode))); + ll_intent_release(&it); rc = -ESTALE; goto out_unplug; }