Whamcloud - gitweb
LU-13617 llite: don't hold inode_lock for security notify 92/38792/3
authorAlexander Boyko <c17825@cray.com>
Mon, 1 Jun 2020 12:32:11 +0000 (08:32 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 23 Jun 2020 08:11:45 +0000 (08:11 +0000)
commitf87359b51f61a4baa9bf62faebb6625d518d23b4
tree160ea38b6fb32db009cc807656e32dd57b4d9d47
parentcb499096d7de27dc886365900874eba33693ab06
LU-13617 llite: don't hold inode_lock for security notify

With selinux enabled client has a dead lock which leads to
client eviction from MDS.
1 thread                    2 thread
do file open                do stat
inode_lock(parend dir)
                            got LDLM_PR(parent dir)
enqueue LDLM_CW(parent dir) waits on inode_lock to notify security
waits
timeout on enqueue
and client eviction because client didn't cancel a LDLM_PR lock

security_inode_notifysecctx()->selinux_inode_notifysecctx()->
selinux_inode_setsecurity()
The call of selinux_inode_setsecurity doesn't need to hold
inode_lock.

Fixes: 1d44980bcb ("LU-8956 llite: set sec ctx on client's inode at create time")
Signed-off-by: Alexander Boyko <alexander.boyko@hpe.com>
Cray-bug-id: LUS-8924
Change-Id: I4727da45590734bde57bee9d378b61c30b5d515a
Reviewed-on: https://review.whamcloud.com/38792
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/dir.c
lustre/llite/namei.c