From: David Anderson Date: Sat, 3 Mar 2018 02:44:14 +0000 (-0800) Subject: AOSP: e2fsck: Skip duplicate blocks when RO_COMPAT_SHARED_BLOCKS is set. X-Git-Tag: v1.44.3-rc1~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c5413b1aedd2706c3daff6c051fd3b483e5b62f;p=thirdparty%2Fe2fsprogs.git AOSP: e2fsck: Skip duplicate blocks when RO_COMPAT_SHARED_BLOCKS is set. If RO_COMPAT_SHARED_BLOCKS is set, the duplicate block pass is skipped entirely. Signed-off-by: Theodore Ts'o Google-Bug-Id: 64109868 Test: f_shared_blocks_ok Change-Id: I49a9d6c5012d5e76c9a47578a45cae7484df4c4a From AOSP commit: 93d12bc16bffd39a56b1e08aefbc641eba298077 --- diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 69b3f09e7..35a05037c 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -2261,6 +2261,8 @@ static _INLINE_ void mark_block_used(e2fsck_t ctx, blk64_t block) clear_problem_context(&pctx); if (ext2fs_fast_test_block_bitmap2(ctx->block_found_map, block)) { + if (ext2fs_has_feature_shared_blocks(ctx->fs->super)) + return; if (!ctx->block_dup_map) { pctx.errcode = e2fsck_allocate_block_bitmap(ctx->fs, _("multiply claimed block map"), diff --git a/tests/f_shared_blocks_ok/expect.1 b/tests/f_shared_blocks_ok/expect.1 new file mode 100644 index 000000000..de4363b93 --- /dev/null +++ b/tests/f_shared_blocks_ok/expect.1 @@ -0,0 +1,7 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 13/32 files (0.0% non-contiguous), 12/64 blocks +Exit status is 0 diff --git a/tests/f_shared_blocks_ok/expect.2 b/tests/f_shared_blocks_ok/expect.2 new file mode 100644 index 000000000..de4363b93 --- /dev/null +++ b/tests/f_shared_blocks_ok/expect.2 @@ -0,0 +1,7 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 13/32 files (0.0% non-contiguous), 12/64 blocks +Exit status is 0 diff --git a/tests/f_shared_blocks_ok/image.gz b/tests/f_shared_blocks_ok/image.gz new file mode 100644 index 000000000..db747e271 Binary files /dev/null and b/tests/f_shared_blocks_ok/image.gz differ diff --git a/tests/f_shared_blocks_ok/name b/tests/f_shared_blocks_ok/name new file mode 100644 index 000000000..c77dbbd31 --- /dev/null +++ b/tests/f_shared_blocks_ok/name @@ -0,0 +1 @@ +clean check for intentionally shared blocks