]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
Add --force-if-data-lost to bcachefs device set-state
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 9 Apr 2021 21:25:19 +0000 (17:25 -0400)
committerKent Overstreet <kent.overstreet@gmail.com>
Fri, 9 Apr 2021 21:42:26 +0000 (17:42 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
cmd_device.c

index f9e975abc2b93916e0ea820aac1d3845e241a416..b18bdd8c6f2e0a89bffb5e0e74fb0352e2a918f2 100644 (file)
@@ -331,6 +331,7 @@ static void device_set_state_usage(void)
             "\n"
             "Options:\n"
             "  -f, --force                 Force, if data redundancy will be degraded\n"
+            "      --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>");
@@ -341,6 +342,7 @@ int cmd_device_set_state(int argc, char *argv[])
 {
        static const struct option longopts[] = {
                { "force",                      0, NULL, 'f' },
+               { "force-if-data-lost",         0, NULL, 'F' },
                { "offline",                    0, NULL, 'o' },
                { "help",                       0, NULL, 'h' },
                { NULL }
@@ -355,6 +357,10 @@ int cmd_device_set_state(int argc, char *argv[])
                case 'f':
                        flags |= BCH_FORCE_IF_DEGRADED;
                        break;
+               case 'F':
+                       flags |= BCH_FORCE_IF_DEGRADED;
+                       flags |= BCH_FORCE_IF_LOST;
+                       break;
                case 'o':
                        offline = true;
                        break;