linux-stable/block
Jianchao Wang ee29369424 block: fix the DISCARD request merge
[ Upstream commit 6984046608 ]

There are two cases when handle DISCARD merge.
If max_discard_segments == 1, the bios/requests need to be contiguous
to merge. If max_discard_segments > 1, it takes every bio as a range
and different range needn't to be contiguous.

But now, attempt_merge screws this up. It always consider contiguity
for DISCARD for the case max_discard_segments > 1 and cannot merge
contiguous DISCARD for the case max_discard_segments == 1, because
rq_attempt_discard_merge always returns false in this case.
This patch fixes both of the two cases above.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jianchao Wang <jianchao.w.wang@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-01 09:13:49 +01:00
..
partitions partitions/aix: fix usage of uninitialized lv_info and lvname structures 2018-09-19 22:43:44 +02:00
badblocks.c badblocks: fix wrong return value in badblocks_set if badblocks are disabled 2017-12-20 10:10:26 +01:00
bfq-cgroup.c block: bfq: swap puts in bfqg_and_blkg_put 2018-09-19 22:43:35 +02:00
bfq-iosched.c blok, bfq: do not plug I/O if all queues are weight-raised 2019-11-20 18:00:00 +01:00
bfq-iosched.h
bfq-wf2q.c block, bfq: correctly charge and reset entity service in all cases 2018-11-13 11:14:55 -08:00
bio-integrity.c block/bio-integrity: fix a memory leak bug 2019-07-31 07:28:55 +02:00
bio.c block: bio_iov_iter_get_pages: pin more pages for multi-segment IOs 2019-07-03 13:15:58 +02:00
blk-cgroup.c blkcg: init root blkcg_gq under lock 2018-06-21 04:02:44 +09:00
blk-core.c blk-mq: move cancel of requeue_work into blk_mq_release 2019-06-15 11:54:54 +02:00
blk-exec.c
blk-flush.c blk-mq: fix a hung issue when fsync 2019-02-20 10:20:44 +01:00
blk-integrity.c
blk-ioc.c
blk-lib.c block: fix infinite loop if the device loses discard capability 2018-12-29 13:39:07 +01:00
blk-map.c blk_rq_map_user_iov: fix error override 2018-02-25 11:07:49 +01:00
blk-merge.c block: fix the DISCARD request merge 2019-12-01 09:13:49 +01:00
blk-mq-cpumap.c blk-mq: don't keep offline CPUs mapped to hctx 0 2018-04-19 08:56:20 +02:00
blk-mq-debugfs.c blk-mq-debugfs: don't allow write on attributes with seq_operations set 2018-04-26 11:02:11 +02:00
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c blk-mq: only attempt to merge bio if there is rq in sw queue 2018-09-26 08:38:13 +02:00
blk-mq-sched.h
blk-mq-sysfs.c
blk-mq-tag.c blk-mq: fix updating tags depth 2018-09-19 22:43:39 +02:00
blk-mq-tag.h
blk-mq-virtio.c
blk-mq.c blk-mq: move cancel of requeue_work to the front of blk_exit_queue 2019-10-05 12:47:37 +02:00
blk-mq.h blk-mq: fix sysfs inflight counter 2018-06-21 04:02:49 +09:00
blk-settings.c block: allow max_discard_segments to be stacked 2018-09-26 08:38:00 +02:00
blk-softirq.c
blk-stat.c
blk-stat.h
blk-sysfs.c blk-mq: move cancel of requeue_work to the front of blk_exit_queue 2019-10-05 12:47:37 +02:00
blk-tag.c
blk-throttle.c block-throttle: avoid double charge 2017-12-29 17:53:47 +01:00
blk-timeout.c
blk-wbt.c blk-wbt: account flush requests correctly 2018-02-22 15:42:29 +01:00
blk-wbt.h
blk-zoned.c blkdev_report_zones_ioctl(): Use vmalloc() to allocate large buffers 2018-06-16 09:45:14 +02:00
blk.h block: drain queue before waiting for q_usage_counter becoming zero 2018-03-03 10:24:35 +01:00
bounce.c block: don't let passthrough IO go into .make_request_fn() 2018-01-02 20:31:05 +01:00
bsg-lib.c
bsg.c
cfq-iosched.c cfq: Suppress compiler warnings about comparisons 2018-09-15 09:45:31 +02:00
cmdline-parser.c
compat_ioctl.c
deadline-iosched.c
elevator.c elevator: lookup mq vs non-mq elevators 2018-12-21 14:13:10 +01:00
genhd.c blk-mq: fix sysfs inflight counter 2018-06-21 04:02:49 +09:00
ioctl.c
ioprio.c
Kconfig
Kconfig.iosched
kyber-iosched.c block: kyber: fix domain token leak during requeue 2018-03-08 22:41:05 -08:00
Makefile
mq-deadline.c
noop-iosched.c
opal_proto.h
partition-generic.c blk-mq: fix sysfs inflight counter 2018-06-21 04:02:49 +09:00
scsi_ioctl.c
sed-opal.c block: sed-opal: fix IOC_OPAL_ENABLE_DISABLE_MBR 2019-05-31 06:47:29 -07:00
t10-pi.c