From: "Jun'ichi Nomura" <j-nomura@ce.jp.nec.com>
To: Hannes Reinecke <hare@suse.de>
Cc: Theodore Tso <tytso@mit.edu>,
linux-scsi@vger.kernel.org, Dave Chinner <david@fromorbit.com>,
James Bottomley <jbottomley@parallels.com>,
device-mapper development <dm-devel@redhat.com>,
Ren Mingxin <renmx@cn.fujitsu.com>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 4/5] scsi: Return ENODATA on medium error
Date: Mon, 01 Jul 2013 18:12:51 +0900 [thread overview]
Message-ID: <51D14813.6070803@ce.jp.nec.com> (raw)
In-Reply-To: <1372666331-66996-5-git-send-email-hare@suse.de>
On 07/01/13 17:12, Hannes Reinecke wrote:
> When a medium error is detected the SCSI stack should return
> ENODATA to the upper layers.
Hi Hannes,
since you change the error code from -EREMOTEIO to -ENODATA/-ENOSPC,
upper layers that checks -EREMOTEIO have to be updated as well.
Something like below for dm-multipath.
It seems btrfs checking -EREMOTEIO, too.
--
Jun'ichi Nomura, NEC Corporation
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index bdf26f5..15bf881 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1261,6 +1261,21 @@ static void activate_path(struct work_struct *work)
pg_init_done, pgpath);
}
+static int maybe_path_failure(int error)
+{
+ switch(error) {
+ case -EOPNOTSUPP:
+ case -EREMOTEIO:
+ case -EILSEQ:
+ case -ENOSPC:
+ case -ENODATA:
+ return 0;
+ }
+
+ /* Anything else could be a path failure */
+ return 1;
+}
+
/*
* end_io handling
*/
@@ -1284,7 +1299,7 @@ static int do_end_io(struct multipath *m, struct request *clone,
if (!error && !clone->errors)
return 0; /* I/O complete */
- if (error == -EOPNOTSUPP || error == -EREMOTEIO || error == -EILSEQ)
+ if (!maybe_path_failure(error))
return error;
if (mpio->pgpath)
next parent reply other threads:[~2013-07-01 9:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1372666331-66996-1-git-send-email-hare@suse.de>
[not found] ` <1372666331-66996-5-git-send-email-hare@suse.de>
2013-07-01 9:12 ` Jun'ichi Nomura [this message]
2013-07-01 9:51 ` [PATCH 4/5] scsi: Return ENODATA on medium error Hannes Reinecke
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=51D14813.6070803@ce.jp.nec.com \
--to=j-nomura@ce.jp.nec.com \
--cc=david@fromorbit.com \
--cc=dm-devel@redhat.com \
--cc=hare@suse.de \
--cc=jbottomley@parallels.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=renmx@cn.fujitsu.com \
--cc=tytso@mit.edu \
/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