Whamcloud - gitweb
LU-15757 llite: check s_root ll_md_blocking_ast() 86/47086/2
authorAlex Zhuravlev <bzzz@whamcloud.com>
Tue, 19 Apr 2022 12:01:14 +0000 (15:01 +0300)
committerOleg Drokin <green@whamcloud.com>
Thu, 12 May 2022 15:44:17 +0000 (15:44 +0000)
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 <bzzz@whamcloud.com>
Change-Id: I61c1d29a7de3084ad1dfd0c216cee628418b7038
Reviewed-on: https://review.whamcloud.com/47086
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/namei.c

index 23e3709..68981dc 100644 (file)
@@ -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))