diff options
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index e5fdcc6c2e67..169e3e15a30e 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c @@ -1408,9 +1408,12 @@ static void sanitize_disk_conf(struct drbd_device *device, struct disk_conf *dis if (disk_conf->al_extents > drbd_al_extents_max(nbc)) disk_conf->al_extents = drbd_al_extents_max(nbc); - if (!blk_queue_discard(q) || !q->limits.discard_zeroes_data) { - disk_conf->rs_discard_granularity = 0; /* disable feature */ - drbd_info(device, "rs_discard_granularity feature disabled\n"); + if (!blk_queue_discard(q) + || (!q->limits.discard_zeroes_data && !disk_conf->discard_zeroes_if_aligned)) { + if (disk_conf->rs_discard_granularity) { + disk_conf->rs_discard_granularity = 0; /* disable feature */ + drbd_info(device, "rs_discard_granularity feature disabled\n"); + } } if (disk_conf->rs_discard_granularity) { |