]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
Improve compiler compatibility + run blkid remove for all filesystems
authorjpsollie <janpieter.sollie@edpnet.be>
Wed, 9 Jun 2021 13:03:38 +0000 (15:03 +0200)
committerKent Overstreet <kent.overstreet@gmail.com>
Sun, 13 Jun 2021 05:09:56 +0000 (01:09 -0400)
add a blk_wipe function to remove any possible filesystems left on the block device
this makes sure the automounter does not accidentally mount it as another filesystem.

Signed-off by: Janpieter Sollie <janpieter.sollie@edpnet.be>

tools-util.c

index 361419aec5fc09a09611ef9e84f9d8e393076d1b..3cc0de444cf95b32d2def2e16c476c6bd726bcb6 100644 (file)
@@ -289,6 +289,8 @@ int open_for_format(const char *dev, bool force)
                fputs("Proceed anyway?", stdout);
                if (!ask_yn())
                        exit(EXIT_FAILURE);
+               while (blkid_do_probe(pr) == 0)
+                       blkid_do_wipe(pr, 0);
        }
 
        blkid_free_probe(pr);