zfs icon indicating copy to clipboard operation
zfs copied to clipboard

zpool: force-faulted disks report "repairing"

Open tonyhutter opened this issue 3 years ago • 0 comments

System information

Type Version/Name
Distribution Name RHEL
Distribution Version 7.9
Kernel Version 3.10
Architecture x86_64
OpenZFS Version zfs-0.7.7 (and master)

Describe the problem you're observing

A faulted disk was showing (repairing)

Describe how to reproduce the problem

We saw a case where zpool status was showing as force-faulted disk as (repairing):

	    U78     FAULTED      3     2     0  external device fault  (repairing)

I believe this happened because the vdev was being resilvered at the time it was force-faulted, causing it's "bytes repaired" counter (vs->vs_scan_processed) to be frozen in time. zpool status saw that vs->vs_scan_processed was non-zero and assumed it was being repaired.

The fix is to just print (repairing) only if the disk is healthy:

--- zfs-0.7.7/cmd/zpool/zpool_main.c	2018-03-26 14:22:36.000000000 -0700
+++ zfs-0.7.7-new/cmd/zpool/zpool_main.c	2022-09-19 12:35:16.348977517 -0700
@@ -1757,7 +1757,8 @@
 	    (uint64_t **)&ps, &c);
 
 	if (ps && ps->pss_state == DSS_SCANNING &&
-	    vs->vs_scan_processed != 0 && children == 0) {
+	    vs->vs_scan_processed != 0 && children == 0 &&
+	    vs->vs_state == VDEV_STATE_HEALTHY) {
 		(void) printf(gettext("  (%s)"),
 		    (ps->pss_func == POOL_SCAN_RESILVER) ?
 		    "resilvering" : "repairing");

Note that while this was observed on zfs-0.7.7, I believe the bug is present in master as well.

Include any warning/errors/backtraces from the system logs

tonyhutter avatar Sep 19 '22 21:09 tonyhutter