For requests that are sent only to remote component use the

error from remote.
Approved by:	pjd (mentor)
MFC after:	1 week
This commit is contained in:
Mikolaj Golub 2011-03-22 19:49:27 +00:00
parent cdec385674
commit b068d5aafb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=219879

View File

@ -1610,9 +1610,14 @@ ggate_send_thread(void *arg)
if (ii == ncomps) {
/*
* None of the requests were successful.
* Use first error.
* Use the error from local component except the
* case when we did only remote request.
*/
ggio->gctl_error = hio->hio_errors[0];
if (ggio->gctl_cmd == BIO_READ &&
res->hr_syncsrc == HAST_SYNCSRC_SECONDARY)
ggio->gctl_error = hio->hio_errors[1];
else
ggio->gctl_error = hio->hio_errors[0];
}
if (ggio->gctl_error == 0 && ggio->gctl_cmd == BIO_WRITE) {
mtx_lock(&res->hr_amp_lock);