diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-05-21 21:41:00 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-05-21 21:41:04 -0400 |
commit | fa0a54c45c44e8ff3885ccc72a43fd2d96e01b14 (patch) | |
tree | a4e513a24a874ad54561cd9efc9c120d78df219a /c_src/cmd_dump.c | |
parent | be35429fa2ae5dd6cc17664e2dd3c23b4c691028 (diff) |
cmd_dump: Don't use noexcl by default
This has been leading to too many people taking metadata dumps of rw
mounted filesystems.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'c_src/cmd_dump.c')
-rw-r--r-- | c_src/cmd_dump.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/c_src/cmd_dump.c b/c_src/cmd_dump.c index c6b813e9..eb338858 100644 --- a/c_src/cmd_dump.c +++ b/c_src/cmd_dump.c @@ -23,10 +23,11 @@ static void dump_usage(void) "Usage: bcachefs dump [OPTION]... <devices>\n" "\n" "Options:\n" - " -o output Output qcow2 image(s)\n" - " -f, --force Force; overwrite when needed\n" - " --nojournal Don't dump entire journal, just dirty entries\n" - " -h, --help Display this help and exit\n" + " -o output Output qcow2 image(s)\n" + " -f, --force Force; overwrite when needed\n" + " --nojournal Don't dump entire journal, just dirty entries\n" + " --noexcl Open devices with O_NOEXCL (not recommended)\n" + " -h, --help Display this help and exit\n" "Report bugs to <linux-bcachefs@vger.kernel.org>"); } @@ -101,6 +102,7 @@ int cmd_dump(int argc, char *argv[]) static const struct option longopts[] = { { "force", no_argument, NULL, 'f' }, { "nojournal", no_argument, NULL, 'j' }, + { "noexcl", no_argument, NULL, 'e' }, { "verbose", no_argument, NULL, 'v' }, { "help", no_argument, NULL, 'h' }, { NULL } @@ -112,7 +114,6 @@ int cmd_dump(int argc, char *argv[]) int fd, opt; opt_set(opts, direct_io, false); - opt_set(opts, noexcl, true); opt_set(opts, read_only, true); opt_set(opts, nochanges, true); opt_set(opts, norecovery, true); @@ -132,6 +133,9 @@ int cmd_dump(int argc, char *argv[]) case 'j': entire_journal = false; break; + case 'e': + opt_set(opts, noexcl, true); + break; case 'v': opt_set(opts, verbose, true); break; |