diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c index 32e4f3c1e6b0..cc7d8fcc3bd6 100644 --- a/module/zfs/zvol.c +++ b/module/zfs/zvol.c @@ -1245,6 +1245,7 @@ __zvol_create_minor(const char *name) #ifdef HAVE_BLK_QUEUE_DISCARD blk_queue_max_discard_sectors(zv->zv_queue, (zvol_max_discard_blocks * zv->zv_volblocksize) >> 9); + zv->zv_queue->limits.discard_granularity = zv->zv_volblocksize; queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, zv->zv_queue); #endif #ifdef HAVE_BLK_QUEUE_NONROT