Re: [PATCH] virtio-blk: Check the max discard segment for discard request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 24, 2022 at 9:34 PM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
> On Wed, Feb 23, 2022 at 09:36:27PM +0800, Xie Yongji wrote:
> > Currently we have a BUG_ON() to make sure the number of sg list
> > does not exceed queue_max_segments() in virtio_queue_rq().
> > However, the block layer uses queue_max_discard_segments()
> > instead of queue_max_segments() to limit the sg list for
> > discard requests. So the BUG_ON() might be triggered if
> > virtio-blk device reports a larger value for max discard
> > segment than queue_max_segments(). To fix it, this patch
> > checks the max discard segment for the discard request
> > in the BUG_ON() instead.
>
> This looks god, but jut removing the BUG_ON might be even better.

LGTM. If no objection, I will do it in v2.

Thanks,
Yongji



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux