mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-01-23 00:07:07 +03:00
cmd_device_set_state: use buffered IO for writing superblock
The layout may be unaligned on 4k sector devices - but there's no reason we need to use direct IO here. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
cc1f2deb96
commit
a29cb4b9f8
@ -418,9 +418,12 @@ int cmd_device_set_state(int argc, char *argv[])
|
||||
|
||||
le64_add_cpu(&sb.sb->seq, 1);
|
||||
|
||||
bch2_super_write(sb.bdev->bd_fd, sb.sb);
|
||||
bch2_super_write(sb.bdev->bd_buffered_fd, sb.sb);
|
||||
ret = fsync(sb.bdev->bd_buffered_fd);
|
||||
if (ret)
|
||||
fprintf(stderr, "error writing superblock: fsync error (%m)");
|
||||
bch2_free_super(&sb);
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *fs_path = arg_pop();
|
||||
|
Loading…
Reference in New Issue
Block a user