From: Alex Zhuravlev Date: Tue, 19 Apr 2022 12:01:14 +0000 (+0300) Subject: LU-15757 llite: check s_root ll_md_blocking_ast() X-Git-Tag: 2.15.2-RC1~16 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F48406%2F3;p=fs%2Flustre-release.git 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 --- 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))