Message ID | 20240812133032.115134-8-w@uter.be (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | nbd: WRITE_ZEROES and a few fixes | expand |
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index fdcf0bbedf3b..235ab5f59608 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -339,7 +339,7 @@ static int __nbd_set_size(struct nbd_device *nbd, loff_t bytesize, lim = queue_limits_start_update(nbd->disk->queue); if (nbd->config->flags & NBD_FLAG_SEND_TRIM) - lim.max_hw_discard_sectors = UINT_MAX; + lim.max_hw_discard_sectors = UINT_MAX >> SECTOR_SHIFT; else lim.max_hw_discard_sectors = 0; if (!(nbd->config->flags & NBD_FLAG_SEND_FLUSH)) {