Commit 51aa3228 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Alasdair G Kergon

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: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent 5af443a7
...@@ -364,6 +364,7 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions, ...@@ -364,6 +364,7 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions,
return -EIO; return -EIO;
} }
retry:
io.error_bits = 0; io.error_bits = 0;
io.eopnotsupp_bits = 0; io.eopnotsupp_bits = 0;
atomic_set(&io.count, 1); /* see dispatch_io() */ 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, ...@@ -382,6 +383,11 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions,
} }
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
if (io.eopnotsupp_bits && (rw & (1 << BIO_RW_BARRIER))) {
rw &= ~(1 << BIO_RW_BARRIER);
goto retry;
}
if (error_bits) if (error_bits)
*error_bits = io.error_bits; *error_bits = io.error_bits;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment