From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752083AbcFTDEj (ORCPT ); Sun, 19 Jun 2016 23:04:39 -0400 Received: from linuxhacker.ru ([217.76.32.60]:57748 "EHLO fiona.linuxhacker.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751872AbcFTDEH (ORCPT ); Sun, 19 Jun 2016 23:04:07 -0400 From: Oleg Drokin To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger Cc: Linux Kernel Mailing List , Lustre Development List , Bruno Faccini , Oleg Drokin Subject: [PATCH 04/28] staging/lustre/llite: lock i_lock before __d_drop() Date: Sun, 19 Jun 2016 22:07:19 -0400 Message-Id: <1466388463-1817551-5-git-send-email-green@linuxhacker.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466388463-1817551-1-git-send-email-green@linuxhacker.ru> References: <1466388463-1817551-1-git-send-email-green@linuxhacker.ru> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bruno Faccini There has been several Lustre Client crashes reported by sites running with Lustre versions 2.1/2.5, all showing the same dentry->d_hash->next corrupted pointer cause. This patch fixes a regression that has been introduced since a long time by commit : (LU-506 kernel: FC15 - support dcache scalability changes.) where i_lock protection usage has been removed and that is likely to cause racy condition during dentry [un]hashing and to be the root cause of these crashes. Signed-off-by: Bruno Faccini Reviewed-on: http://review.whamcloud.com/19287 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7973 Reviewed-by: Lai Siyao Reviewed-by: Yang Sheng Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/llite/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index b0c4548..5436a54 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -2975,8 +2975,11 @@ static int __ll_inode_revalidate(struct dentry *dentry, __u64 ibits) * here to preserve get_cwd functionality on 2.6. * Bug 10503 */ - if (!d_inode(dentry)->i_nlink) + if (!d_inode(dentry)->i_nlink) { + spin_lock(&inode->i_lock); d_lustre_invalidate(dentry, 0); + spin_unlock(&inode->i_lock); + } ll_lookup_finish_locks(&oit, inode); } else if (!ll_have_md_lock(d_inode(dentry), &ibits, LCK_MINMODE)) { -- 2.7.4