All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Subject: [PATCH v3 10/12] btrfs-progs: fsck-test: Add new test case for file extent false alerts
Date: Tue, 21 Feb 2017 16:34:36 +0800	[thread overview]
Message-ID: <20170221083438.25719-11-quwenruo@cn.fujitsu.com> (raw)
In-Reply-To: <20170221083438.25719-1-quwenruo@cn.fujitsu.com>

Lowmem mode exposed several false alerts, all related to file extents
check.

1) Partly written prealloc extent
   Cause lowmem mode to report missing csum or prealloc extent should
   not have csum

2) Compressed inline extent
   Cause lowmem mode to find mismatch on inline len and item len.
   While no error message is output but exit silently.

Reported-by: Chris Murphy <chris@colorremedies.com>
Reported-by: Christoph Anton Mitterer <calestyo@scientia.net>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
 tests/fsck-tests/025-file-extents/test.sh | 42 +++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100755 tests/fsck-tests/025-file-extents/test.sh

diff --git a/tests/fsck-tests/025-file-extents/test.sh b/tests/fsck-tests/025-file-extents/test.sh
new file mode 100755
index 00000000..cb64c500
--- /dev/null
+++ b/tests/fsck-tests/025-file-extents/test.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+# Confirm btrfs check can check file extents without causing false alert
+
+source $TOP/tests/common
+
+check_prereq btrfs
+check_prereq mkfs.btrfs
+check_global_prereq xfs_io
+check_global_prereq fallocate
+
+setup_root_helper
+prepare_test_dev 128M
+
+# Do some write into a large prealloc range
+# Lowmem mode can report missing csum due to wrong csum range
+test_paritical_write_into_prealloc()
+{
+	run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
+	run_check_mount_test_dev
+
+	run_check fallocate -l 128K "$TEST_MNT/file"
+	sync
+	run_check xfs_io -c "pwrite 0 64K" "$TEST_MNT/file"
+	run_check_umount_test_dev
+	run_check "$TOP/btrfs" check "$TEST_DEV"
+}
+
+# Inline compressed file extent
+# Lowmem mode can cause silent error without any error message
+# due to too restrict check on inline extent size
+test_compressed_inline_extent()
+{
+	run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
+	run_check_mount_test_dev -o compress=lzo,max_inline=2048
+
+	run_check xfs_io -f -c "pwrite 0 1K" "$TEST_MNT/file"
+	run_check_umount_test_dev
+	run_check "$TOP/btrfs" check "$TEST_DEV"
+}
+
+test_paritical_write_into_prealloc
+test_compressed_inline_extent
-- 
2.11.1




  parent reply	other threads:[~2017-02-21  8:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21  8:34 [PATCH v3 00/12] lowmem mode fixes Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 01/12] btrfs-progs: lowmem check: Fix several bugs related to afterward search Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 02/12] btrfs-progs: check: Output verbose error when fsck found a bug in any tree Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 03/12] btrfs-progs: lowmem check: Fix false alert in checking data extent csums Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 04/12] btrfs-progs: lowmem check: Fix extent item size false alert Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 05/12] btrfs-progs: lowmem check: Fix false alert on inline compressed extent Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 06/12] btrfs-progs: lowmem check: Fix silent error if first inode item missing Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 07/12] btrfs-progs: tests: Move fsck-tests/015 to fuzz tests Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 08/12] btrfs-progs: fsck-test: Add test image for lowmem mode block group false alert Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 09/12] btrfs-progs: fsck-test: Make 013 compatible with lowmem mode Qu Wenruo
2017-02-21  8:34 ` Qu Wenruo [this message]
2017-03-01 16:27   ` [PATCH v3 10/12] btrfs-progs: fsck-test: Add new test case for file extent false alerts David Sterba
2017-02-21  8:34 ` [PATCH v3 11/12] btrfs-progs: fsck: Fix lowmem mode override to allow it skip repair work Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 12/12] btrfs-progs: cmds-check.c: walk_down_tree_v2 break cause of leaf process Qu Wenruo
2017-03-01 16:30 ` [PATCH v3 00/12] lowmem mode fixes David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170221083438.25719-11-quwenruo@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.