qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Xie Yongji <xieyongji@bytedance.com>
To: pbonzini@redhat.com, kwolf@redhat.com, mreitz@redhat.com
Cc: xieyongji@bytedance.com, qemu-devel@nongnu.org,
	qemu-block@nongnu.org, elohimes@gmail.com
Subject: [PATCH 2/2] iscsi: return -EIO when sense fields are meaningless
Date: Wed,  1 Jul 2020 18:54:44 +0800	[thread overview]
Message-ID: <20200701105444.3226-2-xieyongji@bytedance.com> (raw)
In-Reply-To: <20200701105444.3226-1-xieyongji@bytedance.com>

When an I/O request failed, now we only return correct
value on scsi check condition. We should also have a
default errno such as -EIO in other case.

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
---
 block/iscsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/iscsi.c b/block/iscsi.c
index 2964c9f8d2..387ed872ef 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -241,9 +241,11 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
 
     iTask->status = status;
     iTask->do_retry = 0;
+    iTask->err_code = 0;
     iTask->task = task;
 
     if (status != SCSI_STATUS_GOOD) {
+        iTask->err_code = -EIO;
         if (iTask->retries++ < ISCSI_CMD_RETRIES) {
             if (status == SCSI_STATUS_BUSY ||
                 status == SCSI_STATUS_TIMEOUT ||
-- 
2.11.0



  reply	other threads:[~2020-07-01 13:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 10:54 [PATCH 1/2] iscsi: handle check condition status in retry loop Xie Yongji
2020-07-01 10:54 ` Xie Yongji [this message]
2020-07-01 11:40   ` [PATCH 2/2] iscsi: return -EIO when sense fields are meaningless Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200701105444.3226-2-xieyongji@bytedance.com \
    --to=xieyongji@bytedance.com \
    --cc=elohimes@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).