From e6dd92e27af98b38ba5bd8e7e818efa82971a145 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(). Lustre-change: https://review.whamcloud.com/47086/ Lustre-commit: 0095c0d05ca80a2494710e3b4afb1d1e4b5cdcfe Change-Id: I61c1d29a7de3084ad1dfd0c216cee628418b7038 Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48406 Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- 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 4630aec..d8efda7 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