]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
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 da9f61852752727548dc8df930baa6bd2d98616e..4e3890b2d3e14ccafd972cbe2765fa846acd3b1b 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 e604f4253481f9fb42a9275754307706d7453f62..581fd62d724de2324f240428de0a084876177a41 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 bc44354ffbeb1aa28c2a9a92007ce00969fd0003..89d2aefb59b931ec5ffc4f79af1299a6beb42152 100644 (file)
@@ -1,2 +1,2 @@
-FSCK_OPT="-yf -E unshare_blocks"
+FSCK_OPT="-y -E unshare_blocks"
 . $cmd_dir/run_e2fsck
index bc44354ffbeb1aa28c2a9a92007ce00969fd0003..89d2aefb59b931ec5ffc4f79af1299a6beb42152 100644 (file)
@@ -1,2 +1,2 @@
-FSCK_OPT="-yf -E unshare_blocks"
+FSCK_OPT="-y -E unshare_blocks"
 . $cmd_dir/run_e2fsck