fstests, btrfs: check flakey device instead of backend device
diff mbox series

Message ID 20191120064406.3467779-1-naohiro.aota@wdc.com
State New
Headers show
Series
  • fstests, btrfs: check flakey device instead of backend device
Related show

Commit Message

Naohiro Aota Nov. 20, 2019, 6:44 a.m. UTC
btrfs/085 mount and works on $FLAKEY_DEV, but it's inspecting the
underlying $SCRATCH_DEV. Since writing to dm-flakey does not invalidate
page cache of $SCRATCH_DEV, the btrfs command can read a stalled data
from page cache. We should check the flakey device to avoid such cache
inconsistency.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 tests/btrfs/085 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nikolay Borisov Nov. 20, 2019, 1:15 p.m. UTC | #1
On 20.11.19 г. 8:44 ч., Naohiro Aota wrote:
> btrfs/085 mount and works on $FLAKEY_DEV, but it's inspecting the
> underlying $SCRATCH_DEV. Since writing to dm-flakey does not invalidate
> page cache of $SCRATCH_DEV, the btrfs command can read a stalled data
> from page cache. We should check the flakey device to avoid such cache
> inconsistency.
> 
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com

Patch
diff mbox series

diff --git a/tests/btrfs/085 b/tests/btrfs/085
index 4773ed8041fd..2a31eefd2013 100755
--- a/tests/btrfs/085
+++ b/tests/btrfs/085
@@ -46,7 +46,7 @@  rm -f $seqres.full
 has_orphan_item()
 {
 	INO=$1
-	if $BTRFS_UTIL_PROG inspect-internal dump-tree $SCRATCH_DEV | \
+	if $BTRFS_UTIL_PROG inspect-internal dump-tree $FLAKEY_DEV | \
 		grep -q "key (ORPHAN ORPHAN_ITEM $INO)"; then
 		return 0
 	fi