summaryrefslogtreecommitdiffstats
path: root/block/blk-merge.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2021-04-02 12:33:16 +0200
committerIngo Molnar <mingo@kernel.org>2021-04-02 12:33:16 +0200
commite855e80d001530ec0bbb1ee1ca6a16ac6bdf9acf (patch)
tree5f762f2992658891c565af4f923147b384bf0dd4 /block/blk-merge.c
parentMerge 'x86/alternatives' (diff)
parentLinux 5.12-rc5 (diff)
downloadlinux-e855e80d001530ec0bbb1ee1ca6a16ac6bdf9acf.tar.xz
linux-e855e80d001530ec0bbb1ee1ca6a16ac6bdf9acf.zip
Merge tag 'v5.12-rc5' into WIP.x86/core, to pick up recent NOP related changes
In particular we want to have this upstream commit: b90829704780: ("bpf: Use NOP_ATOMIC5 instead of emit_nops(&prog, 5) for BPF_TRAMP_F_CALL_ORIG") ... before merging in x86/cpu changes and the removal of the NOP optimizations, and applying PeterZ's !retpoline objtool series. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'block/blk-merge.c')
-rw-r--r--block/blk-merge.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c
index ffb4aa0ea68b..4d97fb6dd226 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -382,6 +382,14 @@ unsigned int blk_recalc_rq_segments(struct request *rq)
switch (bio_op(rq->bio)) {
case REQ_OP_DISCARD:
case REQ_OP_SECURE_ERASE:
+ if (queue_max_discard_segments(rq->q) > 1) {
+ struct bio *bio = rq->bio;
+
+ for_each_bio(bio)
+ nr_phys_segs++;
+ return nr_phys_segs;
+ }
+ return 1;
case REQ_OP_WRITE_ZEROES:
return 0;
case REQ_OP_WRITE_SAME: