Message ID | 20231024-vfs-super-freeze-v2-3-599c19f4faac@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Implement freeze and thaw as holder operations | expand |
On Tue, Oct 24, 2023 at 03:01:09PM +0200, Christian Brauner wrote: > When freeze_super() is called, sync_filesystem() will be called which > calls sync_blockdev() and already surfaces any errors. Do the same for > block devices that aren't owned by a superblock and also for filesystems > that don't call sync_blockdev() internally but implicitly rely on > bdev_freeze() to do it. > > Signed-off-by: Christian Brauner <brauner@kernel.org> Yessss less EIO munching in the VFS layer! Reviewed-by: Darrick J. Wong <djwong@kernel.org> --D > --- > block/bdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block/bdev.c b/block/bdev.c > index d674ad381c52..a3e2af580a73 100644 > --- a/block/bdev.c > +++ b/block/bdev.c > @@ -245,7 +245,7 @@ int bdev_freeze(struct block_device *bdev) > bdev->bd_fsfreeze_sb = sb; > > sync: > - sync_blockdev(bdev); > + error = sync_blockdev(bdev); > done: > mutex_unlock(&bdev->bd_fsfreeze_mutex); > return error; > > -- > 2.34.1 >
On Tue 24-10-23 15:01:09, Christian Brauner wrote: > When freeze_super() is called, sync_filesystem() will be called which > calls sync_blockdev() and already surfaces any errors. Do the same for > block devices that aren't owned by a superblock and also for filesystems > that don't call sync_blockdev() internally but implicitly rely on > bdev_freeze() to do it. > > Signed-off-by: Christian Brauner <brauner@kernel.org> Looks good. Feel free to add: Reviewed-by: Jan Kara <jack@suse.cz> Honza > --- > block/bdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block/bdev.c b/block/bdev.c > index d674ad381c52..a3e2af580a73 100644 > --- a/block/bdev.c > +++ b/block/bdev.c > @@ -245,7 +245,7 @@ int bdev_freeze(struct block_device *bdev) > bdev->bd_fsfreeze_sb = sb; > > sync: > - sync_blockdev(bdev); > + error = sync_blockdev(bdev); > done: > mutex_unlock(&bdev->bd_fsfreeze_mutex); > return error; > > -- > 2.34.1 >
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
diff --git a/block/bdev.c b/block/bdev.c index d674ad381c52..a3e2af580a73 100644 --- a/block/bdev.c +++ b/block/bdev.c @@ -245,7 +245,7 @@ int bdev_freeze(struct block_device *bdev) bdev->bd_fsfreeze_sb = sb; sync: - sync_blockdev(bdev); + error = sync_blockdev(bdev); done: mutex_unlock(&bdev->bd_fsfreeze_mutex); return error;
When freeze_super() is called, sync_filesystem() will be called which calls sync_blockdev() and already surfaces any errors. Do the same for block devices that aren't owned by a superblock and also for filesystems that don't call sync_blockdev() internally but implicitly rely on bdev_freeze() to do it. Signed-off-by: Christian Brauner <brauner@kernel.org> --- block/bdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)