Message ID | 20231017184823.1383356-6-hch@lst.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/5] block: simplify bdev_del_partition() | expand |
On Tue, Oct 17, 2023 at 08:48:23PM +0200, Christoph Hellwig wrote: > From: Christian Brauner <brauner@kernel.org> > > 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@kernel.org> > Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ming Lei <ming.lei@redhat.com> thanks, Ming
On Tue 17-10-23 20:48:23, Christoph Hellwig wrote: > From: Christian Brauner <brauner@kernel.org> > > 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@kernel.org> > Signed-off-by: Christoph Hellwig <hch@lst.de> Looks good to me. Feel free to add: Reviewed-by: Jan Kara <jack@suse.cz> 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 >
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;