Skip to content

Commit

Permalink
dm io: retry after barrier error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Jun 22, 2009
1 parent 5af443a commit 51aa322
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/md/dm-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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() */
Expand All @@ -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;

Expand Down

0 comments on commit 51aa322

Please sign in to comment.