Whamcloud - gitweb
LU-11104 mdt: rename may cause deadlock 01/32701/9
authorLai Siyao <lai.siyao@intel.com>
Tue, 12 Jun 2018 04:11:36 +0000 (12:11 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 1 Aug 2018 14:25:46 +0000 (14:25 +0000)
commit2131e4eda8fa354747d09bd3427a0a1d19c931e4
treea11010348401a8d9179538a1bcd4d5a0a4f05e8e
parent954cc6754b19a5eb4b9f717f79037c40baa87f3f
LU-11104 mdt: rename may cause deadlock

In rename locking, there are two situations we need to lock target
parent before source parent:
1. source parent is subdir of target parent.
2. source and target parents are both stripes of the same directory,
   and stripe index of source parent is after that of target parent.

But the check for the second situation is missing, which may cause
deadlock if another thread is taking stripe locks of their parent.

Cleanup mdd_is_subdir().

Add sanityn.sh test_81b.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Change-Id: Ib96fb7b286e7dfdea868ef2fa4919f8d3f1567f9
Reviewed-on: https://review.whamcloud.com/32701
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/md_object.h
lustre/mdd/mdd_dir.c
lustre/mdd/mdd_internal.h
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_reint.c
lustre/tests/sanityn.sh