[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <176169820573.1433624.17669754346289733490.stgit@frogsfrogsfrogs>
Date: Tue, 28 Oct 2025 18:28:45 -0700
From: "Darrick J. Wong" <djwong@...nel.org>
To: djwong@...nel.org, zlang@...hat.com
Cc: neal@...pa.dev, fstests@...r.kernel.org, linux-ext4@...r.kernel.org,
 linux-fsdevel@...r.kernel.org, joannelkoong@...il.com, bernd@...ernd.com
Subject: [PATCH 32/33] generic/730: adapt test for fuse filesystems
From: Darrick J. Wong <djwong@...nel.org>
This test almost works for fuse servers, but needs some fixes:
First, fuse servers do not receive the ->mark_dead notifications that
kernel filesystems receive.  As a result, the read that happens after
the scsi_debug device goes down could very well be served by cached file
data in the fuse server.  Therefore, cycle the mount before reopening
the victim file to flush all cached file data.
Second, the fuse server might decide to go read-only when the read
fails.  In this case, the "cat <&3 > /dev/null" might produce an
additional error when it tries to close "standard input".  These need to
be filtered out too.
Signed-off-by: "Darrick J. Wong" <djwong@...nel.org>
---
 tests/generic/730 |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/tests/generic/730 b/tests/generic/730
index fb86be4ce72ecd..a18a15adf7e9fa 100755
--- a/tests/generic/730
+++ b/tests/generic/730
@@ -42,14 +42,23 @@ run_check _mount_fstyp $SCSI_DEBUG_DEV $SCSI_DEBUG_MNT
 # create a test file
 $XFS_IO_PROG -f -c "pwrite 0 1M" $SCSI_DEBUG_MNT/testfile >>$seqres.full
 
+# cycle the mount to avoid reading from cached metadata, because fuse servers
+# do not receive block device shutdown notifications
+if [[ "$FSTYP" =~ fuse* ]]; then
+	_unmount $SCSI_DEBUG_MNT >>$seqres.full 2>&1
+	run_check _mount_fstyp $SCSI_DEBUG_DEV $SCSI_DEBUG_MNT
+fi
+
 # open a file descriptor for reading the file
 exec 3< $SCSI_DEBUG_MNT/testfile
 
 # delete the scsi debug device while it still has dirty data
 echo 1 > /sys/block/$(_short_dev $SCSI_DEBUG_DEV)/device/delete
 
-# try to read from the file, which should give us -EIO
-cat <&3 > /dev/null
+# try to read from the file, which should give us -EIO.  redirect stderr
+# so that we can filter out additional errors when cat(1) closes stdin
+cat <&3 > /dev/null 2> $tmp.errors
+sed -e '/closing standard input/d' < $tmp.errors
 
 # close the file descriptor to not block unmount
 exec 3<&-
Powered by blists - more mailing lists
 
