Skip to contentSkip to conversation

generic/095: ignore EBUSY for job5 on NFS

PATCH In review [email protected] 3 participants 4 messages Oct 12 – Nov 2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/095: ignore EBUSY for job5 on NFS

From: An Long <[email protected]>

On NFS, the buffered read in job5 occasionally fails with EBUSY:

fio: io_u error on file <dir>/file2: Device or resource busy: read ...

This most likely happens because the client has to invalidate its page cache before reading a file that other jobs may have modified, and that cannot complete while those jobs keep mixing direct, buffered and mmap writes on the same files.

Make this error ignorable for job5 reads only, and only when testing NFS, so that unexpected errors from other jobs or other filesystems are still reported. Since ignore_error given on the fio command line applies to all jobs, move it into the job file, where it can be overridden per job. Behaviour for other filesystems and jobs is unchanged.

---
 tests/generic/095 | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
tests/generic/095 +15 -4
index 828274fd..53afb1de 100755
@@ -25,12 +25,25 @@ numjobs=$((5 * LOAD_FACTOR))
 fio_config=$tmp.fio
 fio_out=$tmp.fio.out
 blksz=`$here/src/min_dio_alignment $SCRATCH_MNT $SCRATCH_DEV`
+
+# There's a known EIO failure to report collisions between directio and buffered
+# writes to userspace, refer to upstream linux 5a9d929d6e13. So ignore EIO error
+# at here.
+#
+# On NFS, the buffered read in job5 may fail with EBUSY, most likely because
+# the client has to invalidate its page cache before reading a stale file, as
+# the file may have been modified by other jobs doing writes, and that cannot
+# complete while those jobs are mixing direct, buffered and mmap I/O on the same
+# files. Ignore EBUSY on reads for job5 on NFS.
+job5_ignore_error=",EIO"
+[ "$FSTYP" = "nfs" ] && job5_ignore_error="EBUSY,EIO"
 cat >$fio_config <<EOF
 [global]
 bs=8k
 iodepth=$iodepth
 iodepth_batch=$iodepth_batch
 randrepeat=1
+ignore_error=,EIO
 size=1m
 directory=$SCRATCH_MNT
 numjobs=$numjobs
@@ -57,6 +70,7 @@ direct=1
 rw=randwrite
 filename=file1:file2
 [job5]
+ignore_error=$job5_ignore_error
 bs=1k
 ioengine=sync
 rw=randread
@@ -86,10 +100,7 @@ echo 'bs=$pagesize' >> $fio_config
 
 _require_fio $fio_config
 
-# There's a known EIO failure to report collisions between directio and buffered
-# writes to userspace, refer to upstream linux 5a9d929d6e13. So ignore EIO error
-# at here.
-$FIO_PROG $fio_config --ignore_error=,EIO --output=$fio_out
+$FIO_PROG $fio_config --output=$fio_out
 cat $fio_out >> $seqres.full
 echo "Silence is golden"
 
Signature · 1 line
2.51.0
author
#1 lore raw

Hi Zorro, Just a gentle ping on this patch. Any feedback or comments would be greatly appreciated.
Thanks,
An Long

Quoted 76 lines · On Mon, Oct 12, 2026 at 10:57 AM <[email protected]> wrote:

From: An Long <[email protected]>

On NFS, the buffered read in job5 occasionally fails with EBUSY:

fio: io_u error on file <dir>/file2: Device or resource busy: read ...

This most likely happens because the client has to invalidate its page cache before reading a file that other jobs may have modified, and that cannot complete while those jobs keep mixing direct, buffered and mmap writes on the same files.

Make this error ignorable for job5 reads only, and only when testing NFS, so that unexpected errors from other jobs or other filesystems are still reported. Since ignore_error given on the fio command line applies to all jobs, move it into the job file, where it can be overridden per job. Behaviour for other filesystems and jobs is unchanged.

---
 tests/generic/095 | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
tests/generic/095 +15 -5
index 828274fd..53afb1de 100755
@@ -25,12 +25,25 @@ numjobs=$((5 * LOAD_FACTOR))
 fio_config=$tmp.fio
 fio_out=$tmp.fio.out
 blksz=`$here/src/min_dio_alignment $SCRATCH_MNT $SCRATCH_DEV`
+
+# There's a known EIO failure to report collisions between directio and buffered
+# writes to userspace, refer to upstream linux 5a9d929d6e13. So ignore EIO error
+# at here.
+#
+# On NFS, the buffered read in job5 may fail with EBUSY, most likely because
+# the client has to invalidate its page cache before reading a stale file, as
+# the file may have been modified by other jobs doing writes, and that cannot
+# complete while those jobs are mixing direct, buffered and mmap I/O on the same
+# files. Ignore EBUSY on reads for job5 on NFS.
+job5_ignore_error=",EIO"
+[ "$FSTYP" = "nfs" ] && job5_ignore_error="EBUSY,EIO"
 cat >$fio_config <<EOF
 [global]
 bs=8k
 iodepth=$iodepth
 iodepth_batch=$iodepth_batch
 randrepeat=1
+ignore_error=,EIO
 size=1m
 directory=$SCRATCH_MNT
 numjobs=$numjobs
@@ -57,6 +70,7 @@ direct=1
 rw=randwrite
 filename=file1:file2
 [job5]
+ignore_error=$job5_ignore_error
 bs=1k
 ioengine=sync
 rw=randread
@@ -86,10 +100,7 @@ echo 'bs=$pagesize' >> $fio_config
 
 _require_fio $fio_config
 
-# There's a known EIO failure to report collisions between directio and buffered
-# writes to userspace, refer to upstream linux 5a9d929d6e13. So ignore EIO error
-# at here.
-$FIO_PROG $fio_config --ignore_error=,EIO --output=$fio_out
+$FIO_PROG $fio_config --output=$fio_out
 cat $fio_out >> $seqres.full
 echo "Silence is golden"
 
--

2.51.0

#3 lore raw
In reply to [email protected]
Quoted 11 lines · On Mon, Oct 12, 2026 at 10:57:07AM +0800, [email protected] wrote:

From: An Long <[email protected]>

On NFS, the buffered read in job5 occasionally fails with EBUSY:

fio: io_u error on file <dir>/file2: Device or resource busy: read ...

This most likely happens because the client has to invalidate its page cache before reading a file that other jobs may have modified, and that cannot complete while those jobs keep mixing direct, buffered and mmap writes on the same files.

Quoted 5 lines

Make this error ignorable for job5 reads only, and only when testing NFS, so that unexpected errors from other jobs or other filesystems are still reported. Since ignore_error given on the fio command line applies to all jobs, move it into the job file, where it can be overridden per job. Behaviour for other filesystems and jobs is unchanged.

File system specific hacks in common code are usually not a good idea. And I think in this case nfs is broken - just like other file systems it should fall back to buffered I/O when the invalidation fails.

#2 lore raw
In reply to Long An
Quoted 2 lines · Long An

Hi Zorro, Just a gentle ping on this patch. Any feedback or comments would be greatly appreciated.

Sorry for the delayed reply on this patch. Looking at the patch description, it seems there is no conclusive evidence yet as to what actually causes this test failure. Before having xfstests simply ignore an error, we should have a solid justification. It might be better to bring this up on the linux-nfs mailing list first to confirm whether this is a known issue on the NFS side.

Thanks,
Zorro

Quoted 82 lines

Thanks,
An Long

Quoted 76 lines · On Mon, Oct 12, 2026 at 10:57 AM <[email protected]> wrote:

From: An Long <[email protected]>

On NFS, the buffered read in job5 occasionally fails with EBUSY:

fio: io_u error on file <dir>/file2: Device or resource busy: read ...

This most likely happens because the client has to invalidate its page cache before reading a file that other jobs may have modified, and that cannot complete while those jobs keep mixing direct, buffered and mmap writes on the same files.

Make this error ignorable for job5 reads only, and only when testing NFS, so that unexpected errors from other jobs or other filesystems are still reported. Since ignore_error given on the fio command line applies to all jobs, move it into the job file, where it can be overridden per job. Behaviour for other filesystems and jobs is unchanged.

---
 tests/generic/095 | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
tests/generic/095 +15 -5
index 828274fd..53afb1de 100755
@@ -25,12 +25,25 @@ numjobs=$((5 * LOAD_FACTOR))
 fio_config=$tmp.fio
 fio_out=$tmp.fio.out
 blksz=`$here/src/min_dio_alignment $SCRATCH_MNT $SCRATCH_DEV`
+
+# There's a known EIO failure to report collisions between directio and buffered
+# writes to userspace, refer to upstream linux 5a9d929d6e13. So ignore EIO error
+# at here.
+#
+# On NFS, the buffered read in job5 may fail with EBUSY, most likely because
+# the client has to invalidate its page cache before reading a stale file, as
+# the file may have been modified by other jobs doing writes, and that cannot
+# complete while those jobs are mixing direct, buffered and mmap I/O on the same
+# files. Ignore EBUSY on reads for job5 on NFS.
+job5_ignore_error=",EIO"
+[ "$FSTYP" = "nfs" ] && job5_ignore_error="EBUSY,EIO"
 cat >$fio_config <<EOF
 [global]
 bs=8k
 iodepth=$iodepth
 iodepth_batch=$iodepth_batch
 randrepeat=1
+ignore_error=,EIO
 size=1m
 directory=$SCRATCH_MNT
 numjobs=$numjobs
@@ -57,6 +70,7 @@ direct=1
 rw=randwrite
 filename=file1:file2
 [job5]
+ignore_error=$job5_ignore_error
 bs=1k
 ioengine=sync
 rw=randread
@@ -86,10 +100,7 @@ echo 'bs=$pagesize' >> $fio_config
 
 _require_fio $fio_config
 
-# There's a known EIO failure to report collisions between directio and buffered
-# writes to userspace, refer to upstream linux 5a9d929d6e13. So ignore EIO error
-# at here.
-$FIO_PROG $fio_config --ignore_error=,EIO --output=$fio_out
+$FIO_PROG $fio_config --output=$fio_out
 cat $fio_out >> $seqres.full
 echo "Silence is golden"
 
--

2.51.0