aboutsummaryrefslogtreecommitdiff
path: root/drivers/md/dm-io.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2009-06-22 10:12:26 +0100
committerAlasdair G Kergon <agk@redhat.com>2009-06-22 10:12:26 +0100
commit51aa322849581f1a73594e48ea0df63f914ee6a2 (patch)
tree19b3545084700fc36b5a916d71473936628bb062 /drivers/md/dm-io.c
parent5af443a7e1c0864100cc44525a9821aa2a2f4719 (diff)
downloadlinux-51aa322849581f1a73594e48ea0df63f914ee6a2.tar.gz
dm io: retry after barrier error
If -EOPNOTSUPP was returned and the request was a barrier request, retry it without barrier. Retry all regions for now. Barriers are submitted only for one-region requests, so it doesn't matter. (In the future, retries can be limited to the actual regions that failed.) Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-io.c')
-rw-r--r--drivers/md/dm-io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c
index a89f41f0075..3a2e6a2f8bd 100644
--- a/drivers/md/dm-io.c
+++ b/drivers/md/dm-io.c
@@ -364,6 +364,7 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions,
return -EIO;
}
+retry:
io.error_bits = 0;
io.eopnotsupp_bits = 0;
atomic_set(&io.count, 1); /* see dispatch_io() */
@@ -382,6 +383,11 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions,
}
set_current_state(TASK_RUNNING);
+ if (io.eopnotsupp_bits && (rw & (1 << BIO_RW_BARRIER))) {
+ rw &= ~(1 << BIO_RW_BARRIER);
+ goto retry;
+ }
+
if (error_bits)
*error_bits = io.error_bits;