X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=cmd_device.c;h=e3c5d513bf3026111ca5c49d68a1744041326172;hb=8f5545af53ee17857ceb2e38e5e4664287a8f296;hp=ef2dfa14654d2a3c6d5f37f48678f611b9c5fc3c;hpb=dafd26afd98f92d8f66346aca7b6361d15f4dd3c;p=bcachefs-tools-debian diff --git a/cmd_device.c b/cmd_device.c index ef2dfa1..e3c5d51 100644 --- a/cmd_device.c +++ b/cmd_device.c @@ -53,7 +53,7 @@ static void device_add_usage(void) " -f, --force Use device even if it appears to already be formatted\n" " -h, --help Display this help and exit\n" "\n" - "Report bugs to "); + "Report bugs to "); } int cmd_device_add(int argc, char *argv[]) @@ -147,7 +147,7 @@ static void device_remove_usage(void) " -F, --force-metadata Force removal, even if some metadata\n" " couldn't be migrated\n" " -h, --help display this help and exit\n" - "Report bugs to "); + "Report bugs to "); exit(EXIT_SUCCESS); } @@ -214,7 +214,7 @@ static void device_online_usage(void) "Options:\n" " -h, --help Display this help and exit\n" "\n" - "Report bugs to "); + "Report bugs to "); } int cmd_device_online(int argc, char *argv[]) @@ -251,7 +251,7 @@ static void device_offline_usage(void) " -f, --force Force, if data redundancy will be degraded\n" " -h, --help Display this help and exit\n" "\n" - "Report bugs to "); + "Report bugs to "); } int cmd_device_offline(int argc, char *argv[]) @@ -295,7 +295,7 @@ static void device_evacuate_usage(void) "Options:\n" " -h, --help Display this help and exit\n" "\n" - "Report bugs to "); + "Report bugs to "); } int cmd_device_evacuate(int argc, char *argv[]) @@ -350,7 +350,7 @@ static void device_set_state_usage(void) " --force-if-data-lost Force, if data will be lost\n" " -o, --offline Set state of an offline device\n" " -h, --help display this help and exit\n" - "Report bugs to "); + "Report bugs to "); exit(EXIT_SUCCESS); } @@ -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(); @@ -451,7 +454,7 @@ static void device_resize_usage(void) "\n" "Options:\n" " -h, --help display this help and exit\n" - "Report bugs to "); + "Report bugs to "); exit(EXIT_SUCCESS); } @@ -559,7 +562,7 @@ static void device_resize_journal_usage(void) "\n" "Options:\n" " -h, --help display this help and exit\n" - "Report bugs to "); + "Report bugs to "); exit(EXIT_SUCCESS); }