public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: Update btrfs/215
@ 2020-12-03 12:11 Nikolay Borisov
  2020-12-06 13:30 ` Eryu Guan
  0 siblings, 1 reply; 2+ messages in thread
From: Nikolay Borisov @ 2020-12-03 12:11 UTC (permalink / raw)
  To: fstests; +Cc: linux-btrfs, Nikolay Borisov

This patch updates btrfs/215 to work with latest upstream kernel. That's
required since commit 324bcf54c449 ("mm: use limited read-ahead to satisfy read")
changed readahead logic to always issue a read even if the RA pages are
set to 0. This results in 1 extra io being issued so the counts in the
test should be incremented by 1. Also use the opportunity to update the
commit reference since it's been merged in the upstream kernel.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 tests/btrfs/215 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/btrfs/215 b/tests/btrfs/215
index 4acc288a9f60..2647fa41ef86 100755
--- a/tests/btrfs/215
+++ b/tests/btrfs/215
@@ -6,7 +6,7 @@
 #
 # Test that reading corrupted files would correctly increment device status
 # counters. This is fixed by the following linux kernel commit:
-# btrfs: Increment device corruption error in case of checksum error
+# 814723e0a55a ("btrfs: increment device corruption error in case of checksum error")
 #
 seq=`basename $0`
 seqres=$RESULT_DIR/$seq
@@ -74,15 +74,15 @@ echo 0 > /sys/fs/btrfs/$uuid/bdi/read_ahead_kb
 # page by page
 $XFS_IO_PROG -c "pread -b $filesize 0 $filesize" "$SCRATCH_MNT/foobar" > /dev/null 2>&1
 errs=$($BTRFS_UTIL_PROG device stats $SCRATCH_DEV | awk '/corruption_errs/ { print $2 }')
-if [ $errs -ne 1 ]; then
-	_fail "Errors: $errs expected: 1"
+if [ $errs -ne 2 ]; then
+	_fail "Errors: $errs expected: 2"
 fi
 
 # DIO does check every sector
 $XFS_IO_PROG -d -c "pread -b $filesize 0 $filesize" "$SCRATCH_MNT/foobar" > /dev/null 2>&1
 errs=$($BTRFS_UTIL_PROG device stats $SCRATCH_DEV | awk '/corruption_errs/ { print $2 }')
-if [ $errs -ne 5 ]; then
-	_fail "Errors: $errs expected: 1"
+if [ $errs -ne 6 ]; then
+	_fail "Errors: $errs expected: 6"
 fi
 
 # success, all done
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs: Update btrfs/215
  2020-12-03 12:11 [PATCH] btrfs: Update btrfs/215 Nikolay Borisov
@ 2020-12-06 13:30 ` Eryu Guan
  0 siblings, 0 replies; 2+ messages in thread
From: Eryu Guan @ 2020-12-06 13:30 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: fstests, linux-btrfs

On Thu, Dec 03, 2020 at 02:11:39PM +0200, Nikolay Borisov wrote:
> This patch updates btrfs/215 to work with latest upstream kernel. That's
> required since commit 324bcf54c449 ("mm: use limited read-ahead to satisfy read")
> changed readahead logic to always issue a read even if the RA pages are
> set to 0. This results in 1 extra io being issued so the counts in the
> test should be incremented by 1. Also use the opportunity to update the
> commit reference since it's been merged in the upstream kernel.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
>  tests/btrfs/215 | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/btrfs/215 b/tests/btrfs/215
> index 4acc288a9f60..2647fa41ef86 100755
> --- a/tests/btrfs/215
> +++ b/tests/btrfs/215
> @@ -6,7 +6,7 @@
>  #
>  # Test that reading corrupted files would correctly increment device status
>  # counters. This is fixed by the following linux kernel commit:
> -# btrfs: Increment device corruption error in case of checksum error
> +# 814723e0a55a ("btrfs: increment device corruption error in case of checksum error")
>  #
>  seq=`basename $0`
>  seqres=$RESULT_DIR/$seq
> @@ -74,15 +74,15 @@ echo 0 > /sys/fs/btrfs/$uuid/bdi/read_ahead_kb
>  # page by page

The comments above this line should be updated as well.

# buffered reads whould result in a single error since the read is done

And I think it's better to describe the 1 extra io in comments as well.

Thanks,
Eryu

>  $XFS_IO_PROG -c "pread -b $filesize 0 $filesize" "$SCRATCH_MNT/foobar" > /dev/null 2>&1
>  errs=$($BTRFS_UTIL_PROG device stats $SCRATCH_DEV | awk '/corruption_errs/ { print $2 }')
> -if [ $errs -ne 1 ]; then
> -	_fail "Errors: $errs expected: 1"
> +if [ $errs -ne 2 ]; then
> +	_fail "Errors: $errs expected: 2"
>  fi
>  
>  # DIO does check every sector
>  $XFS_IO_PROG -d -c "pread -b $filesize 0 $filesize" "$SCRATCH_MNT/foobar" > /dev/null 2>&1
>  errs=$($BTRFS_UTIL_PROG device stats $SCRATCH_DEV | awk '/corruption_errs/ { print $2 }')
> -if [ $errs -ne 5 ]; then
> -	_fail "Errors: $errs expected: 1"
> +if [ $errs -ne 6 ]; then
> +	_fail "Errors: $errs expected: 6"
>  fi
>  
>  # success, all done
> -- 
> 2.17.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-06 13:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-03 12:11 [PATCH] btrfs: Update btrfs/215 Nikolay Borisov
2020-12-06 13:30 ` Eryu Guan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox