diff options
Diffstat (limited to 'drivers/md/dm-io.c')
-rw-r--r-- | drivers/md/dm-io.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index ed9c86cd053e..4789c42d9a3a 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c | |||
@@ -353,7 +353,7 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions, | |||
353 | { | 353 | { |
354 | struct io io; | 354 | struct io io; |
355 | 355 | ||
356 | if (num_regions > 1 && rw != WRITE) { | 356 | if (num_regions > 1 && (rw & RW_MASK) != WRITE) { |
357 | WARN_ON(1); | 357 | WARN_ON(1); |
358 | return -EIO; | 358 | return -EIO; |
359 | } | 359 | } |
@@ -390,7 +390,7 @@ static int async_io(struct dm_io_client *client, unsigned int num_regions, | |||
390 | { | 390 | { |
391 | struct io *io; | 391 | struct io *io; |
392 | 392 | ||
393 | if (num_regions > 1 && rw != WRITE) { | 393 | if (num_regions > 1 && (rw & RW_MASK) != WRITE) { |
394 | WARN_ON(1); | 394 | WARN_ON(1); |
395 | fn(1, context); | 395 | fn(1, context); |
396 | return -EIO; | 396 | return -EIO; |
@@ -436,7 +436,12 @@ static int dp_init(struct dm_io_request *io_req, struct dpages *dp) | |||
436 | } | 436 | } |
437 | 437 | ||
438 | /* | 438 | /* |
439 | * New collapsed (a)synchronous interface | 439 | * New collapsed (a)synchronous interface. |
440 | * | ||
441 | * If the IO is asynchronous (i.e. it has notify.fn), you must either unplug | ||
442 | * the queue with blk_unplug() some time later or set the BIO_RW_SYNC bit in | ||
443 | * io_req->bi_rw. If you fail to do one of these, the IO will be submitted to | ||
444 | * the disk after q->unplug_delay, which defaults to 3ms in blk-settings.c. | ||
440 | */ | 445 | */ |
441 | int dm_io(struct dm_io_request *io_req, unsigned num_regions, | 446 | int dm_io(struct dm_io_request *io_req, unsigned num_regions, |
442 | struct dm_io_region *where, unsigned long *sync_error_bits) | 447 | struct dm_io_region *where, unsigned long *sync_error_bits) |