If there are no shared blocks in a ext4 file system, e2fsck -E
unshare_blocks will not actually clear the shared_blocks feature flag
since e2fsck_pass1_dupblocks() is never called. Fix this by adding a
check in e2fsck_pass1() to clear the shared blocks flag.
https://github.com/tytso/e2fsprogs/issues/218
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit
707af4359e132bc415c3f6339f4ced9f23b28c0b)
fix_problem(ctx, PR_1_DUP_BLOCKS_PREENSTOP, &pctx);
}
e2fsck_pass1_dupblocks(ctx, block_buf);
+ } else if ((ctx->options & E2F_OPT_UNSHARE_BLOCKS) &&
+ ext2fs_has_feature_shared_blocks(fs->super) &&
+ !(ctx->options & E2F_OPT_NO)) {
+ ext2fs_clear_feature_shared_blocks(fs->super);
+ ext2fs_mark_super_dirty(fs);
}
ctx->flags |= E2F_FLAG_ALLOC_OK;
endit: