X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmd%2Fdm-io.c;h=4789c42d9a3ac503d53ba6ea77fe7fadbee21682;hb=ea0c62f7cf70f13a67830471b613337bd0c9a62e;hp=ed9c86cd053e81f32b5c6551d3246461c00d5d30;hpb=a765e20eeb423d0fa6a02ffab51141e53bbd93cb;p=linux-2.6 diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index ed9c86cd05..4789c42d9a 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, { struct io io; - if (num_regions > 1 && rw != WRITE) { + if (num_regions > 1 && (rw & RW_MASK) != WRITE) { WARN_ON(1); return -EIO; } @@ -390,7 +390,7 @@ static int async_io(struct dm_io_client *client, unsigned int num_regions, { struct io *io; - if (num_regions > 1 && rw != WRITE) { + if (num_regions > 1 && (rw & RW_MASK) != WRITE) { WARN_ON(1); fn(1, context); return -EIO; @@ -436,7 +436,12 @@ static int dp_init(struct dm_io_request *io_req, struct dpages *dp) } /* - * New collapsed (a)synchronous interface + * New collapsed (a)synchronous interface. + * + * If the IO is asynchronous (i.e. it has notify.fn), you must either unplug + * the queue with blk_unplug() some time later or set the BIO_RW_SYNC bit in + * io_req->bi_rw. If you fail to do one of these, the IO will be submitted to + * the disk after q->unplug_delay, which defaults to 3ms in blk-settings.c. */ int dm_io(struct dm_io_request *io_req, unsigned num_regions, struct dm_io_region *where, unsigned long *sync_error_bits)