]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - cmd_device.c
New upstream release
[bcachefs-tools-debian] / cmd_device.c
index ef2dfa14654d2a3c6d5f37f48678f611b9c5fc3c..e3c5d513bf3026111ca5c49d68a1744041326172 100644 (file)
@@ -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 <linux-bcache@vger.kernel.org>");
+            "Report bugs to <linux-bcachefs@vger.kernel.org>");
 }
 
 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 <linux-bcache@vger.kernel.org>");
+            "Report bugs to <linux-bcachefs@vger.kernel.org>");
        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 <linux-bcache@vger.kernel.org>");
+            "Report bugs to <linux-bcachefs@vger.kernel.org>");
 }
 
 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 <linux-bcache@vger.kernel.org>");
+            "Report bugs to <linux-bcachefs@vger.kernel.org>");
 }
 
 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 <linux-bcache@vger.kernel.org>");
+            "Report bugs to <linux-bcachefs@vger.kernel.org>");
 }
 
 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 <linux-bcache@vger.kernel.org>");
+            "Report bugs to <linux-bcachefs@vger.kernel.org>");
        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 <linux-bcache@vger.kernel.org>");
+            "Report bugs to <linux-bcachefs@vger.kernel.org>");
        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 <linux-bcache@vger.kernel.org>");
+            "Report bugs to <linux-bcachefs@vger.kernel.org>");
        exit(EXIT_SUCCESS);
 }