max_discard_sectors must be set for the queue to support discard.
Operations implementing discard for rbd zero data, so report that.

Signed-off-by: Josh Durgin <[email protected]>
---
 drivers/block/rbd.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index c8fc8fc..8f908c4 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3595,6 +3595,8 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
        queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
        q->limits.discard_granularity = segment_size;
        q->limits.discard_alignment = segment_size;
+       q->limits.max_discard_sectors = segment_size / SECTOR_SIZE;
+       q->limits.discard_zeroes_data = 1;
 
        blk_queue_merge_bvec(q, rbd_merge_bvec);
        disk->queue = q;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to