is at least one bio status message. It is a much nicer user experience when
we properly report failures, however in the case that we fail to do this,
getting an errno back from the ioctl is somewhat better than simply
printing "unknown error" from bioctl(8).
-/* $OpenBSD: softraid.c,v 1.381 2017/06/06 19:01:27 krw Exp $ */
+/* $OpenBSD: softraid.c,v 1.382 2017/06/12 15:43:25 jsing Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
sc->sc_status.bs_status = (rv ? BIO_STATUS_ERROR : BIO_STATUS_SUCCESS);
+ if (sc->sc_status.bs_msg_count > 0)
+ rv = 0;
+
memcpy(&bio->bio_status, &sc->sc_status, sizeof(struct bio_status));
rw_exit_write(&sc->sc_lock);
- return (0);
+ return (rv);
}
int