Fix the zfsd_fault_001_pos test

Due to a regression in ZFS, a pool's status may not change to DEGRADED
promptly after a vdev becomes faulted.  This test is primarily concerned
with vdev status, not pool status, so work around the bug by doing a
"zpool reopen".  Otherwise the test would time out waiting for a status
change that never came.

MFC to stable/14 only.

https://github.com/openzfs/zfs/issues/16245

MFC after:	2 weeks
Sponsored by:	ConnectWise
This commit is contained in:
Alan Somers 2025-05-02 08:48:58 -06:00
parent c50c5a47a9
commit 01a1dd3218

View file

@ -78,6 +78,10 @@ for type in "raidz" "mirror"; do
$DD if=/dev/zero bs=128k count=1 >> \
/$TESTPOOL/$TESTFS/$TESTFILE 2> /dev/null
$FSYNC /$TESTPOOL/$TESTFS/$TESTFILE
# Due to a bug outside of zfsd, it may be necessary to reopen
# the pool before it will become DEGRADED.
# https://github.com/openzfs/zfs/issues/16245
$ZPOOL reopen $TESTPOOL
# Check to see if the pool is faulted yet
$ZPOOL status $TESTPOOL | grep -q 'state: DEGRADED'
if [ $? == 0 ]