Merge "e2fsck: Skip duplicate blocks when RO_COMPAT_SHARED_BLOCKS is set."
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 7c5ae4d..c5fdbf7 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -2131,6 +2131,8 @@
 	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 0000000..de4363b
--- /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 0000000..de4363b
--- /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 0000000..db747e2
--- /dev/null
+++ b/tests/f_shared_blocks_ok/image.gz
Binary files differ
diff --git a/tests/f_shared_blocks_ok/name b/tests/f_shared_blocks_ok/name
new file mode 100644
index 0000000..c77dbbd
--- /dev/null
+++ b/tests/f_shared_blocks_ok/name
@@ -0,0 +1 @@
+clean check for intentionally shared blocks