Re: [PATCH 5/5] fs: assert that open_mutex isn't held over holder ops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue 17-10-23 20:48:23, Christoph Hellwig wrote:
> From: Christian Brauner <brauner@xxxxxxxxxx>
> 
> With recent block level changes we should never be in a situation where
> we hold disk->open_mutex when calling into these helpers. So assert that
> in the code.
> 
> Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Looks good to me. Feel free to add:

Reviewed-by: Jan Kara <jack@xxxxxxx>

								Honza

> ---
>  fs/super.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/super.c b/fs/super.c
> index 26b96191e9b3ca..ce54cfcecaa156 100644
> --- a/fs/super.c
> +++ b/fs/super.c
> @@ -1443,6 +1443,7 @@ static void fs_bdev_mark_dead(struct block_device *bdev, bool surprise)
>  
>  	/* bd_holder_lock ensures that the sb isn't freed */
>  	lockdep_assert_held(&bdev->bd_holder_lock);
> +	lockdep_assert_not_held(&bdev->bd_disk->open_mutex);
>  
>  	if (!super_lock_shared_active(sb))
>  		return;
> @@ -1462,6 +1463,7 @@ static void fs_bdev_sync(struct block_device *bdev)
>  	struct super_block *sb = bdev->bd_holder;
>  
>  	lockdep_assert_held(&bdev->bd_holder_lock);
> +	lockdep_assert_not_held(&bdev->bd_disk->open_mutex);
>  
>  	if (!super_lock_shared_active(sb))
>  		return;
> -- 
> 2.39.2
> 
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux