aboutsummaryrefslogtreecommitdiffstats
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
authorMing Lei <[email protected]>2021-06-28 02:33:12 +0000
committerJens Axboe <[email protected]>2021-06-29 13:41:08 +0000
commit2705dfb2094777e405e065105e307074af8965c1 (patch)
tree1fdc528a77f5be9455dcedf07b303dbceac04bd1 /net/switchdev/switchdev.c
parentblock/mq-deadline: Remove a WARN_ON_ONCE() call (diff)
downloadkernel-2705dfb2094777e405e065105e307074af8965c1.tar.gz
kernel-2705dfb2094777e405e065105e307074af8965c1.zip
block: fix discard request merge
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. Cc: Christoph Hellwig <[email protected]> Reported-by: Wang Shanker <[email protected]> Signed-off-by: Ming Lei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions