Re: [PATCH, RFC] addjust discard request to be aligned with hwsect size to support SSDs with larger sector size

From: Jiaying Zhang
Date: Mon May 17 2010 - 15:27:36 EST

On Sun, May 16, 2010 at 6:38 AM, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
> On Wed, May 12, 2010 at 10:19:53PM -0700, Jiaying Zhang wrote:
>> The currect blkdev_issue_discard() function assumes 512 sector size.
>> We have seen some problem when using discard on a SSD that has larger
>> sector size. The following patch adjusts the starting address and size of
>> a discard request to be aligned with hwsect size.
> Looks good,
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
>> -     if (!blk_queue_discard(q))
>> +     if (!blk_queue_discard(q) || q->limits.max_discard_sectors == 0)
>>               return -EOPNOTSUPP;
> But this change is unrelated.  It's fine with me, but needs a patch of
> it's own with a proper description.
I will break the patch into two.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at