summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-rq.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-04-08 23:39:36 -0700
committerDavid S. Miller <davem@davemloft.net>2019-04-08 23:39:36 -0700
commit310655b07ae8ef0b8fdb641b610ded2052215664 (patch)
treed9b7a500ef21a087a337e1f1bb9218000cf1c03d /drivers/md/dm-rq.c
parent7f301cff1fc20c5b91203c5e610cf95782081d5d (diff)
parent869e3305f23dfeacdaa234717c92ccb237815d90 (diff)
downloadlinux-310655b07ae8ef0b8fdb641b610ded2052215664.tar.bz2
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/md/dm-rq.c')
-rw-r--r--drivers/md/dm-rq.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c
index 09773636602d..b66745bd08bb 100644
--- a/drivers/md/dm-rq.c
+++ b/drivers/md/dm-rq.c
@@ -222,11 +222,14 @@ static void dm_done(struct request *clone, blk_status_t error, bool mapped)
}
if (unlikely(error == BLK_STS_TARGET)) {
- if (req_op(clone) == REQ_OP_WRITE_SAME &&
- !clone->q->limits.max_write_same_sectors)
+ if (req_op(clone) == REQ_OP_DISCARD &&
+ !clone->q->limits.max_discard_sectors)
+ disable_discard(tio->md);
+ else if (req_op(clone) == REQ_OP_WRITE_SAME &&
+ !clone->q->limits.max_write_same_sectors)
disable_write_same(tio->md);
- if (req_op(clone) == REQ_OP_WRITE_ZEROES &&
- !clone->q->limits.max_write_zeroes_sectors)
+ else if (req_op(clone) == REQ_OP_WRITE_ZEROES &&
+ !clone->q->limits.max_write_zeroes_sectors)
disable_write_zeroes(tio->md);
}