Whamcloud - gitweb
LU-16807 llite: make lsm_sem nested for ll_update_dir_depth 92/51192/4
authorJames Simmons <jsimmons@infradead.org>
Fri, 9 Jun 2023 12:09:45 +0000 (08:09 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 20 Jun 2023 03:48:50 +0000 (03:48 +0000)
commitfe44198b7fb710fce0f3daf669952c11ea0f4189
treecfded85b972784bbf9279b38ad040108d2065f33
parent41761f7534caa532784a7947e5ed1b1b74cb5e70
LU-16807 llite: make lsm_sem nested for ll_update_dir_depth

Lockdep is reporting:

chmod/16751 is trying to acquire lock:
 (&lli->lli_lsm_sem){++++}-{3:3}, at: ll_update_dir_depth+0x8b/0x280

but task is already holding lock:
 (&lli->lli_lsm_sem){++++}-{3:3}, at: ll_update_dir_depth+0x7b/0x280

 other info that might help us debug this:
 Possible unsafe locking scenario:

        CPU0
        ----
 lock(&lli->lli_lsm_sem);
 lock(&lli->lli_lsm_sem);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

Lockdep sees acquiring more than one lock of the same lock class
as a potential dead lock. The execption is if the locks are used
for objects that belong to a hierarchy. For our case of the
lsm_sem we do have a hierarchy since a lsm for a child directory
is related to the parent directory lsm that is being protected
as well. Create new lock classes for the lsm_sem with proper
ordering.

Change-Id: I06c890d16816b83492cbeadabde3515ee0233424
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51192
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/llite/llite_lib.c