From 0095c0d05ca80a2494710e3b4afb1d1e4b5cdcfe Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Tue, 19 Apr 2022 15:01:14 +0300 Subject: [PATCH] LU-15757 llite: check s_root ll_md_blocking_ast() ll_md_blocking_ast() can be called in the context of import invalidation which in turn caused by umount. this way ll_md_blocking_ast() and umount can race and ll_md_blocking_ast() can found sb->s_root NULL which should be checked before calling into is_root_inode(). Signed-off-by: Alex Zhuravlev Change-Id: I61c1d29a7de3084ad1dfd0c216cee628418b7038 Reviewed-on: https://review.whamcloud.com/47086 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: James Simmons Tested-by: John L. Hammond Reviewed-by: Oleg Drokin --- lustre/llite/namei.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 23e3709..68981dc 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -383,8 +383,9 @@ static void ll_lock_cancel_bits(struct ldlm_lock *lock, __u64 to_cancel) } } + /* at umount s_root becomes NULL */ if ((bits & (MDS_INODELOCK_LOOKUP | MDS_INODELOCK_PERM)) && - !is_root_inode(inode)) + inode->i_sb->s_root && !is_root_inode(inode)) ll_prune_aliases(inode); if (bits & (MDS_INODELOCK_LOOKUP | MDS_INODELOCK_PERM)) -- 1.8.3.1