On Wed, Sep 27, 2023 at 09:01:42AM -0700, Darrick J. Wong wrote: > > For the bdev->bd_holder_ops == fs_holder_ops case, the freeze_super call > will call sync_filesystem, which calls sync_blockdev. If that fails, > the fsfreeze aborts, and the bdev freeze (at least with the old code) > would also abort. > > For the !bdev->bd_holder_ops case, why not capture the sync_blockdev > error code and decrement bd_fsfreeze_count if the sync failed? Then > this function either returns 0 with the fs and bdev frozen; or an error > code and nothing frozen. Yes, even if that is a behavior change it would be a lot more consistent. Maybe do the capturing of the error code as a prep patch so that it is clearly bisectable. > (Also, does this mean that the new sync_blockdev call at the bottom of > fs_bdev_freeze isn't necessary? Filesystems that do IO in ->freeze_fs > should be flushing the block device.) Various methods including freeze do the sync_blockdev unconditionally. I think this is a bad idea and should be moved into the file systems, but I don't think this is in scope for this series.