Skip to content

block: fix discard merge for single max discard segment

Ming Lei linux-block 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 3 repliesIn review
  2. v23 patches 5 repliesSuperseded
  3. v12 patches 5 repliesSuperseded

Changes in v3 from the cover letter

- one patch style change in patch 1, as suggested by Christoph
- add reviewed-by tag

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3block: respect queue limit of max discard segmentblock/blk-merge.c+9 -20 replies
2/3block: virtio_blk: fix handling single range discard requestdrivers/block/virtio_blk.c+23 -81 reply
3/3block: rename blk_discard_mergable as blk_discard_support_multi_rangeblock/blk-merge.c+7 -41 reply

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchChristoph Hellwig
1/3R-b
2/3R-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH V3 0/3] block: fix discard merge for single max discard segment

Hello,

The 1st patch checks max discard segment limit in request merge code, and one discard request failure is fixed for virtio_blk.

The 2nd patch fixes handling of single max discard segment for virtio_blk, and potential memory corruption is fixed.

The 3rd patch renames the confusing blk_discard_mergable().

The biggest problem is that virtio_blk handles discard request in multi-range style, however it(at least qemu) may claim that multi range discard isn't supported by returning 1 for max discard segment.

V3:
- one patch style change in patch 1, as suggested by Christoph
- add reviewed-by tag

V2:
- add comment
- warn on mismatched bios and discard segment number
- rename blk_discard_mergable

Ming Lei (3):
block: respect queue limit of max discard segment
block: virtio_blk: fix handling single range discard request
block: rename blk_discard_mergable as blk_discard_support_multi_range

 block/blk-merge.c          | 22 ++++++++++++++++------
 drivers/block/virtio_blk.c | 31 +++++++++++++++++++++++--------
 2 files changed, 39 insertions(+), 14 deletions(-)
Cc Christoph Hellwig <[email protected]>
Cc Changpeng Liu <[email protected]>
Cc Daniel Verkamp <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
Cc Stefano Garzarella <[email protected]>
Signature · 1 line
2.25.2