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

From: Christoph Hellwig
Date: Sun May 16 2010 - 09:38:31 EST

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.

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