Mercurial > illumos > nfs4.1
changeset 7473:fad192e9bc57 onnv_98
6739532 Mirror vdev returns ENXIO instead of ECKSUM
author | Neil Perrin <Neil.Perrin@Sun.COM> |
---|---|
date | Tue, 02 Sep 2008 21:30:50 -0600 |
parents | 111b8190c35c |
children | cf43ef60276e |
files | usr/src/uts/common/fs/zfs/vdev_mirror.c |
diffstat | 1 files changed, 13 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/common/fs/zfs/vdev_mirror.c Tue Sep 02 22:03:24 2008 -0500 +++ b/usr/src/uts/common/fs/zfs/vdev_mirror.c Tue Sep 02 21:30:50 2008 -0600 @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/zfs_context.h> #include <sys/spa.h> #include <sys/vdev_impl.h> @@ -339,12 +337,22 @@ } /* + * There's a hierachy of errors: + * EIO > other errors > ENXIO > 0 + * * We preserve any EIOs because those may be worth retrying; * whereas ECKSUM and ENXIO are more likely to be persistent. + * + * ENXIO should only be reported as an error in a mirror + * if all children report ENXIO; */ if (mc->mc_error) { - if (zio->io_error != EIO) - zio->io_error = mc->mc_error; + if (zio->io_error != EIO) { + if (mc->mc_error != ENXIO) + zio->io_error = mc->mc_error; + else if (zio->io_error == 0) + zio->io_error = ENXIO; + } if (!mc->mc_skipped) unexpected_errors++; zio->io_numerrors++;