]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
g_mirror: don't fail reads while losing next-to-last disk
authorAndriy Gapon <avg@FreeBSD.org>
Thu, 27 Jan 2022 10:49:04 +0000 (12:49 +0200)
committerAndriy Gapon <avg@FreeBSD.org>
Thu, 27 Jan 2022 11:22:52 +0000 (13:22 +0200)
commit5d5f44623eb3d121d528060d131ee5d6bcd63489
tree3d0fa1fa8cac5daef4c85eae2551dee54c8df478
parenta95fcd81d5713dd10d70ce9980f15309b3fb7cb6
g_mirror: don't fail reads while losing next-to-last disk

I observed a situation where some read requests failed when a 2-way geom
mirror lost one disk.  The problem appears to be in the logic that skips
retrying a failed request when a mirror has only one active disk.
Generally, that makes sense.  But during a transition from two disks to
one it is possible that the request failed on the failing disk before it
was inactivated and, so, the remaining active disk is the disk that
should be tried.

This change adds an additional check to ensure that it was the (only)
active disk that was already tried.

Reviewed by: mav
MFC after: 3 weeks
sys/geom/mirror/g_mirror.c