[PATCH] btrfs: verify data checksum during _check_btrfs_filesystem()

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



By default btrfs only checks the metadata consistency, but sometimes if
we have some corruption in data while the test case doesn't utilize
scrub to verify, or there is some bugs in scrub itself, we will not
detect those problems.

So here we do one step further by utilizing --check-data-csum option, so
that if there is some data corruption, we can detect them early.

Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
---
 common/btrfs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/btrfs b/common/btrfs
index bd4dc31fa5a8..be8ac04cd9a3 100644
--- a/common/btrfs
+++ b/common/btrfs
@@ -144,7 +144,7 @@ _check_btrfs_filesystem()
 		rm -f $tmp.qgroup_report
 	fi
 
-	$BTRFS_UTIL_PROG check $device >$tmp.fsck 2>&1
+	$BTRFS_UTIL_PROG check --check-data-csum $device >$tmp.fsck 2>&1
 	if [ $? -ne 0 ]; then
 		_log_err "_check_btrfs_filesystem: filesystem on $device is inconsistent"
 		echo "*** fsck.$FSTYP output ***"	>>$seqres.full
-- 
2.41.0




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux