diff options
author | Bruno Faccini <bruno.faccini@intel.com> | 2016-06-20 20:55:27 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-20 21:28:39 (GMT) |
commit | c9cc8d0f6f770635b206784686a16157db3d43b8 (patch) | |
tree | f96ac61072f315556f6479783957fde99bb6f95a | |
parent | 2bbec0ed2c957541f22ba99202827b004267ab58 (diff) | |
download | linux-c9cc8d0f6f770635b206784686a16157db3d43b8.tar.xz |
staging/lustre/llite: lock i_lock before __d_drop()
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/lustre/lustre/llite/file.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 2d50d1c..c46e2ac 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -2963,8 +2963,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)) { |