Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1427066

[PATCH v2 04/29] staging/lustre/llite: lock i_lock before __d_drop()

From Oleg Drokin <green@linuxhacker.ru>
Newsgroups linux.kernel
Subject [PATCH v2 04/29] staging/lustre/llite: lock i_lock before __d_drop()
Date 2016-06-20 23:20 +0200
Message-ID <rMeLU-52j-33@gated-at.bofh.it> (permalink)
References <rMesx-4Gc-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Bruno Faccini <bruno.faccini@intel.com>

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 <bruno.faccini@intel.com>
Reviewed-on: http://review.whamcloud.com/19287
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7973
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/29] Lustre fixes Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:10 +0200
  [PATCH v2 23/29] staging/lustre/llite: ll_revalidate_dentry update Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:10 +0200
  [PATCH v2 24/29] staging/lustre/llite: IOC_MDC_GETFILEINFO returns the wrong ino Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200
  [PATCH v2 05/29] staging/lustre/osc: osc_lock_weight endless loop fix Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200
  [PATCH v2 18/29] staging/lustre/ldlm: const qualify struct lustre_handle * params Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200
  [PATCH v2 17/29] staging/lustre/llite: change it_data to it_request Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200
  [PATCH v2 27/29] staging/lustre/osc: glimpse lock should match only with granted locks Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200
  [PATCH v2 08/29] staging/lustre/ptlrpc: missing wakeup for ptlrpc_check_set Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200
  [PATCH v2 22/29] staging/lustre/llite: Restore proper opencache operations Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200
  [PATCH v2 04/29] staging/lustre/llite: lock i_lock before __d_drop() Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200
  [PATCH v2 01/29] staging/lustre/llite: allocate and free client cache asynchronously Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200
  [PATCH v2 28/29] staging/lustre/libcfs: Do not call kthread_run in wrong state Oleg Drokin <green@linuxhacker.ru> - 2016-06-21 00:10 +0200
  [PATCH v2 06/29] staging/lustre/osc: Fix reverted condition in osc_lock_weight Oleg Drokin <green@linuxhacker.ru> - 2016-06-21 00:10 +0200
  [PATCH v2 07/29] staging/lustre/ptlrpc: reorganize ptlrpc_request Oleg Drokin <green@linuxhacker.ru> - 2016-06-21 00:10 +0200

csiph-web