[Drbd-dev] [PATCH v5 01/11] block: make generic_make_request handle arbitrarily sized bios
Martin K. Petersen
martin.petersen at oracle.com
Mon Aug 10 18:22:07 CEST 2015
>>>>> "Mike" == Mike Snitzer <snitzer at redhat.com> writes:
Mike> Shouldn't we also be using MAX_BIO_SECTORS in
Mike> blkdev_issue_write_same (instead of UINT_MAX >> 9)?
The granularity of WRITE SAME is always 1 logical block and there is no
reason to round it down to the next power of two.
+ * Ensure that max discard sectors doesn't overflow bi_size and hopefully
+ * it is of the proper granularity as long as the granularity is a power
+ * of two.
+#define MAX_DISCARD_SECTORS ((1U << 31) >> 9)
That's fine for SATA since we're already capping at 2TB minus change.
But it means we'll be capping unnecessarily on SCSI. And larger range
counts are impending in SATA as well.
So this goes back to my original comment: The only place there can be a
discard granularity is for SCSI UNMAP. And consequently, we should only
enforce alignment and granularity when that code path is taken in sd.c.
I'm OK with Ming's patch series in general. Let's leave the discard cap
at UINT_MAX and I'll twiddle the rest in SCSI.
Reviewed-by: Martin K. Petersen <martin.petersen at oracle.com>
Martin K. Petersen Oracle Linux Engineering
More information about the drbd-dev