Re: [PATCH] fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb

2021-01-08 Thread Bob Peterson
Hi, > This is the bigger issue, and I'm not very familiar with this code either, > so I'll defer to the experts. Yes, it's a change in behavior, but I think > it makes sense to decrement the bd_fsfreeze_count in this case. Here's why: > > If the blockdev is frozen by freeze_bdev while it's being

Re: [PATCH] fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb

2021-01-08 Thread Bob Peterson
- Original Message - > This causes bdev->bd_fsfreeze_sb to be set to NULL even if the call to > thaw_super right after this line fail. So if a caller tries to call > thaw_bdev() again after receiving such an error, that next call won't even > try to call thaw_super(). Is that what we want h

Re: [PATCH] fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb

2021-01-08 Thread Christoph Hellwig
On Thu, Jan 07, 2021 at 11:08:39PM +, Satya Tangirala wrote: > > error = sb->s_op->freeze_super(sb); > > else > > @@ -600,6 +602,7 @@ int thaw_bdev(struct block_device *bdev) > > if (!sb) > > goto out; > > > > + bdev->bd_fsfreeze_sb = NULL; > This causes bdev

Re: [PATCH] fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb

2021-01-07 Thread Satya Tangirala
ible to emergency_thaw_bdev() in fs/buffer.c) In my version of the patch, I set bdev->bd_fsfreeze_sb to NULL only *after* we check that the call to thaw_super() succeeded to avoid this. > if (sb->s_op->thaw_super) > error = sb->s_op->thaw_super(sb); >

Re: [PATCH] fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb

2021-01-07 Thread Bob Peterson
- Original Message - > Can someone pick this up? Maybe through Jens' block tree as that is > where my commit this is fixing up came from. Christoph and Al, Here is my version: Bob Peterson fs: fix freeze count problem in freeze_bdev Before this patch, if you tried to freeze a device (f

Re: [PATCH] fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb

2021-01-07 Thread Bob Peterson
- Original Message - > Can someone pick this up? Maybe through Jens' block tree as that is > where my commit this is fixing up came from. > > For reference: > > > Reviewed-by: Christoph Hellwig > > On Thu, Dec 24, 2020 at 04:49:54AM +, Satya Tangirala wrote: > > freeze/thaw_bdev()

Re: [PATCH] fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb

2021-01-07 Thread Jens Axboe
On 1/7/21 9:20 AM, Christoph Hellwig wrote: > Can someone pick this up? Maybe through Jens' block tree as that is > where my commit this is fixing up came from. > > For reference: > > > Reviewed-by: Christoph Hellwig Applied, thanks. -- Jens Axboe

Re: [PATCH] fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb

2021-01-07 Thread Christoph Hellwig
Can someone pick this up? Maybe through Jens' block tree as that is where my commit this is fixing up came from. For reference: Reviewed-by: Christoph Hellwig On Thu, Dec 24, 2020 at 04:49:54AM +, Satya Tangirala wrote: > freeze/thaw_bdev() currently use bdev->bd_fsfreeze_count to infer >

Re: [PATCH] fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb

2021-01-04 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH] fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb

2021-01-04 Thread Darrick J. Wong
On Thu, Dec 24, 2020 at 04:49:54AM +, Satya Tangirala wrote: > freeze/thaw_bdev() currently use bdev->bd_fsfreeze_count to infer > whether or not bdev->bd_fsfreeze_sb is valid (it's valid iff > bd_fsfreeze_count is non-zero). thaw_bdev() doesn't nullify > bd_fsfreeze_sb. > > But this means a f

[PATCH] fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb

2020-12-23 Thread Satya Tangirala
freeze/thaw_bdev() currently use bdev->bd_fsfreeze_count to infer whether or not bdev->bd_fsfreeze_sb is valid (it's valid iff bd_fsfreeze_count is non-zero). thaw_bdev() doesn't nullify bd_fsfreeze_sb. But this means a freeze_bdev() call followed by a thaw_bdev() call can leave bd_fsfreeze_sb wit