diff options
author | Hannes Reinecke <hare@suse.de> | 2013-07-01 15:16:26 +0200 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-08-23 18:54:53 +0200 |
commit | 7e782af57649f8a8e943d80104c946a5cd7af7cc (patch) | |
tree | 3ad0cfe04ce16a2a07c50cdfa55a60149de50fc7 /drivers/md/dm-mpath.c | |
parent | [SCSI] return ENOSPC on thin provisioning failure (diff) | |
download | linux-7e782af57649f8a8e943d80104c946a5cd7af7cc.tar.xz linux-7e782af57649f8a8e943d80104c946a5cd7af7cc.zip |
[SCSI] Return ENODATA on medium error
When a medium error is detected the SCSI stack should return
ENODATA to the upper layers.
[jejb: fix whitespace error]
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/md/dm-mpath.c')
-rw-r--r-- | drivers/md/dm-mpath.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 5adede17ddf6..b759a127f9c3 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -1261,6 +1261,20 @@ static void activate_path(struct work_struct *work) pg_init_done, pgpath); } +static int noretry_error(int error) +{ + switch (error) { + case -EOPNOTSUPP: + case -EREMOTEIO: + case -EILSEQ: + case -ENODATA: + return 1; + } + + /* Anything else could be a path failure, so should be retried */ + return 0; +} + /* * end_io handling */ @@ -1284,7 +1298,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 (noretry_error(error)) return error; if (mpio->pgpath) |