Whamcloud - gitweb
AOSP: e2fsck: Skip duplicate blocks when RO_COMPAT_SHARED_BLOCKS is set.
authorDavid Anderson <dvander@google.com>
Sat, 3 Mar 2018 02:44:14 +0000 (18:44 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 21 Jun 2018 13:47:57 +0000 (09:47 -0400)
If RO_COMPAT_SHARED_BLOCKS is set, the duplicate block pass is skipped
entirely.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Google-Bug-Id: 64109868
Test: f_shared_blocks_ok
Change-Id: I49a9d6c5012d5e76c9a47578a45cae7484df4c4a
From AOSP commit: 93d12bc16bffd39a56b1e08aefbc641eba298077

e2fsck/pass1.c
tests/f_shared_blocks_ok/expect.1 [new file with mode: 0644]
tests/f_shared_blocks_ok/expect.2 [new file with mode: 0644]
tests/f_shared_blocks_ok/image.gz [new file with mode: 0644]
tests/f_shared_blocks_ok/name [new file with mode: 0644]

index 69b3f09..35a0503 100644 (file)
@@ -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 (file)
index 0000000..de4363b
--- /dev/null
@@ -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 (file)
index 0000000..de4363b
--- /dev/null
@@ -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 (file)
index 0000000..db747e2
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 (file)
index 0000000..c77dbbd
--- /dev/null
@@ -0,0 +1 @@
+clean check for intentionally shared blocks