Whamcloud - gitweb
AOSP: e2fsck: imply -f when using -E unshare_blocks
authorDavid Anderson <dvander@google.com>
Fri, 11 May 2018 20:34:34 +0000 (13:34 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 21 Jun 2018 14:14:47 +0000 (10:14 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Google-Bug-Id: 64109868
Test: e2fsck -E unshare_blocks does a full scan
Change-Id: Idc36ceba3bf24e1fb1487feedefe9a68f9acc7f3
From AOSP commit: 7c180d6598363722de6195d142d7677bbc2b0161

e2fsck/e2fsck.8.in
e2fsck/unix.c
tests/f_unshare_blocks_no_space/script
tests/f_unshare_blocks_ok/script

index da9f618..4e3890b 100644 (file)
@@ -276,7 +276,7 @@ blocks anyway, then this option will have no effect. Note when using this
 option, if there is no free space to clone blocks, there is no prompt to
 delete files and instead the operation will fail.
 .IP
-Note that unshare_blocks requires the "-f" option to ensure that all passes
+Note that unshare_blocks implies the "-f" option to ensure that all passes
 are run. Additionally, if "-n" is also specified, e2fsck will simulate trying
 to allocate enough space to deduplicate. If this fails, the exit code will
 be non-zero.
index e604f42..581fd62 100644 (file)
@@ -742,6 +742,7 @@ static void parse_extended_opts(e2fsck_t ctx, const char *opts)
                        continue;
                } else if (strcmp(token, "unshare_blocks") == 0) {
                        ctx->options |= E2F_OPT_UNSHARE_BLOCKS;
+                       ctx->options |= E2F_OPT_FORCE;
                        continue;
                } else {
                        fprintf(stderr, _("Unknown extended option: %s\n"),
index bc44354..89d2aef 100644 (file)
@@ -1,2 +1,2 @@
-FSCK_OPT="-yf -E unshare_blocks"
+FSCK_OPT="-y -E unshare_blocks"
 . $cmd_dir/run_e2fsck
index bc44354..89d2aef 100644 (file)
@@ -1,2 +1,2 @@
-FSCK_OPT="-yf -E unshare_blocks"
+FSCK_OPT="-y -E unshare_blocks"
 . $cmd_dir/run_e2fsck