Whamcloud - gitweb
LU-13617 llite: don't hold inode_lock for security notify 25/47025/4
authorAlexander Boyko <c17825@cray.com>
Mon, 1 Jun 2020 12:32:11 +0000 (08:32 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 27 Feb 2024 05:41:27 +0000 (05:41 +0000)
commitf039736f8de805a98420db7ca46d93872e6d53c2
treefacc0b8a39e1fed5899d3bacc1d33bb3e682c940
parent174d0598c5475dea333a50dabeb6784f9526cb14
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.

Lustre-change: https://review.whamcloud.com/38792
Lustre-commit: f87359b51f61a4baa9bf62faebb6625d518d23b4

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-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/47025
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/llite/dir.c
lustre/llite/namei.c