Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 209155
b: refs/heads/master
c: 708e929
h: refs/heads/master
i:
  209153: c145a16
  209151: b53da4c
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Aug 12, 2010
1 parent c02817f commit 24f3ab0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 87c961cb747fa55b664b76abfcb9d44c14ae851f
refs/heads/master: 708e929513502fb050c0a3c3ee267cab5b056ded
15 changes: 13 additions & 2 deletions trunk/drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,14 @@ static void dec_pending(struct dm_io *io, int error)
* There can be just one barrier request so we use
* a per-device variable for error reporting.
* Note that you can't touch the bio after end_io_acct
*
* We ignore -EOPNOTSUPP for empty flush reported by
* underlying devices. We assume that if the device
* doesn't support empty barriers, it doesn't need
* cache flushing commands.
*/
if (!md->barrier_error && io_error != -EOPNOTSUPP)
if (!md->barrier_error &&
!(bio_empty_barrier(bio) && io_error == -EOPNOTSUPP))
md->barrier_error = io_error;
end_io_acct(io);
free_io(md, io);
Expand Down Expand Up @@ -2284,7 +2290,12 @@ static void process_barrier(struct mapped_device *md, struct bio *bio)

if (!bio_empty_barrier(bio)) {
__split_and_process_bio(md, bio);
dm_flush(md);
/*
* If the request isn't supported, don't waste time with
* the second flush.
*/
if (md->barrier_error != -EOPNOTSUPP)
dm_flush(md);
}

if (md->barrier_error != DM_ENDIO_REQUEUE)
Expand Down

0 comments on commit 24f3ab0

Please sign in to comment.