Re: [PATCH RESEND] block: fix discard request merge

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

 



On 6/27/21 8:33 PM, Ming Lei wrote:
> ll_new_hw_segment() is reached only in case of single range discard
> merge, and we don't have max discard segment size limit actually, so
> it is wrong to run the following check:
> 
> if (req->nr_phys_segments + nr_phys_segs > blk_rq_get_max_segments(req))
> 
> it may be always false since req->nr_phys_segments is initialized as
> one, and bio's segment count is still 1, blk_rq_get_max_segments(reg)
> is 1 too.
> 
> Fix the issue by not doing the check and bypassing the calculation of
> discard request's nr_phys_segments.
> 
> Based on analysis from Wang Shanker.

Applied, thanks.

-- 
Jens Axboe




[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