diff options
-rw-r--r-- | drivers/md/dm-io.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index c09359db3a90..37de0173b6d2 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c | |||
@@ -290,6 +290,12 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where, | |||
290 | unsigned short logical_block_size = queue_logical_block_size(q); | 290 | unsigned short logical_block_size = queue_logical_block_size(q); |
291 | sector_t num_sectors; | 291 | sector_t num_sectors; |
292 | 292 | ||
293 | /* Reject unsupported discard requests */ | ||
294 | if ((rw & REQ_DISCARD) && !blk_queue_discard(q)) { | ||
295 | dec_count(io, region, -EOPNOTSUPP); | ||
296 | return; | ||
297 | } | ||
298 | |||
293 | /* | 299 | /* |
294 | * where->count may be zero if rw holds a flush and we need to | 300 | * where->count may be zero if rw holds a flush and we need to |
295 | * send a zero-sized flush. | 301 | * send a zero-sized flush. |