Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1380469 > unrolled thread
| Started by | Christoph Hellwig <hch@infradead.org> |
|---|---|
| First post | 2016-04-16 04:00 +0200 |
| Last post | 2016-04-18 16:00 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCHv2]brd: set max_discard_sectors properly Christoph Hellwig <hch@infradead.org> - 2016-04-16 04:00 +0200
Re: [PATCHv2]brd: set max_discard_sectors properly Jinpu Wang <jinpu.wang@profitbricks.com> - 2016-04-18 10:40 +0200
Re: [PATCHv2]brd: set max_discard_sectors properly Jinpu Wang <jinpu.wang@profitbricks.com> - 2016-04-18 16:00 +0200
| From | Christoph Hellwig <hch@infradead.org> |
|---|---|
| Date | 2016-04-16 04:00 +0200 |
| Subject | Re: [PATCHv2]brd: set max_discard_sectors properly |
| Message-ID | <ronGG-42G-7@gated-at.bofh.it> |
> - blk_queue_max_discard_sectors(brd->brd_queue, UINT_MAX); > + blk_queue_max_discard_sectors(brd->brd_queue, UINT_MAX >> 9); Shouldn't we fix the issue by capping to UINT_MAX >> 9 inside blk_queue_max_discard_sectors? That way we'll prevent against having issues like this in any other driver as well.
[toc] | [next] | [standalone]
| From | Jinpu Wang <jinpu.wang@profitbricks.com> |
|---|---|
| Date | 2016-04-18 10:40 +0200 |
| Message-ID | <rpcSR-2jV-7@gated-at.bofh.it> |
| In reply to | #1380469 |
On Sat, Apr 16, 2016 at 3:50 AM, Christoph Hellwig <hch@infradead.org> wrote: >> - blk_queue_max_discard_sectors(brd->brd_queue, UINT_MAX); >> + blk_queue_max_discard_sectors(brd->brd_queue, UINT_MAX >> 9); > > Shouldn't we fix the issue by capping to UINT_MAX >> 9 inside > blk_queue_max_discard_sectors? That way we'll prevent against having > issues like this in any other driver as well. Thanks Christoph, make sense to me, will rework it to this way. Regards, Jack
[toc] | [prev] | [next] | [standalone]
| From | Jinpu Wang <jinpu.wang@profitbricks.com> |
|---|---|
| Date | 2016-04-18 16:00 +0200 |
| Message-ID | <rphSz-6yD-15@gated-at.bofh.it> |
| In reply to | #1381374 |
On Mon, Apr 18, 2016 at 10:34 AM, Jinpu Wang
<jinpu.wang@profitbricks.com> wrote:
> On Sat, Apr 16, 2016 at 3:50 AM, Christoph Hellwig <hch@infradead.org> wrote:
>>> - blk_queue_max_discard_sectors(brd->brd_queue, UINT_MAX);
>>> + blk_queue_max_discard_sectors(brd->brd_queue, UINT_MAX >> 9);
>>
>> Shouldn't we fix the issue by capping to UINT_MAX >> 9 inside
>> blk_queue_max_discard_sectors? That way we'll prevent against having
>> issues like this in any other driver as well.
>
>
> Thanks Christoph, make sense to me, will rework it to this way.
>
> Regards,
> Jack
It turns out, the real fix is here:
commit 5e4298be45e83ecdffaabb370eea9396889b07f1
Author: Bart Van Assche <bart.vanassche@sandisk.com>
Date: Tue Dec 15 16:38:22 2015 +0100
brd: Fix discard request processing
Avoid that discard requests with size => PAGE_SIZE fail with
-EIO. Refuse discard requests if the discard size is not a
multiple of the page size.
Fixes: 2dbe54957636 ("brd: Refuse improperly aligned discard requests")
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Jan Kara <jack@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Robert Elliot <elliott@hp.com>
Cc: stable <stable@vger.kernel.org> # v4.4+
Signed-off-by: Jens Axboe <axboe@fb.com>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web