Skip to content

badblocks improvement for multiple bad block ranges

Coly Li linux-block linux-raid nvdimm 10 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest7 patches 15 repliesIn review
  2. v5 posting 2/26 patches 4 repliesSuperseded
  3. v5 posting 1/20 of 7 patches 0 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v3 posting 3/36 patches6 repliesSuperseded
v40 of 6 patches0 repliesSuperseded
v3 posting 2/36 patches6 repliesSuperseded
v3 posting 1/30 of 7 patches10 repliesSuperseded
v2 posting 2/20 of 7 patches0 repliesSuperseded
v2 posting 1/26 patches0 repliesSuperseded
v1 RFC6 patches2 repliesSuperseded

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7badblocks: add more helper structure and routines in badblocks.hinclude/linux/badblocks.h+30 -01 reply
2/7badblocks: add helper routines for badblock ranges handlingblock/badblocks.c+377 -02 replies
3/7badblocks: improve badblocks_set() for multiple ranges handlingblock/badblocks.c+544 -202 replies
4/7badblocks: improve badblocks_clear() for multiple ranges handlingblock/badblocks.c+325 -03 replies
5/7badblocks: improve badblocks_check() for multiple ranges handlingblock/badblocks.c+97 -05 replies
6/7badblocks: switch to the improved badblock handling codeblock/badblocks.c+3 -3050 replies
7/7test: user space code to test badblocks APIsbadblocks.c+2256 -00 replies

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by.

PatchXiao Ni
1/7R-b
2/7
3/7
4/7
5/7
6/7
7/7

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

Read the v6 thread

Cover letter [PATCH v6 0/7] badblocks improvement for multiple bad block ranges

This is the v6 version of the badblocks improvement series, which makes badblocks APIs to handle multiple ranges in bad block table.

The change comparing to previous v5 version is the modification against review comments from Xiao Ni,
- Typo fixes in code comments or commit logs.
- The over thought checking conditions like '<=' are simplified as '<'.
- Some unnecessary condition checks are removed.
- In _badblocks_set(), if prev returned from prev_badblocks() is <0, set it properly before jumping to update_sectors. This helps to avoid un- necessary looping.

There is NO in-memory or on-disk format change in the whole series, all existing API and data structures are consistent. This series just only improve the code algorithm to handle more corner cases, the interfaces are same and consistency to all existing callers (md raid and nvdimm drivers).

The original motivation of the change is from the requirement from our customer, that current badblocks routines don't handle multiple ranges. For example if the bad block setting range covers multiple ranges from bad block table, only the first two bad block ranges merged and rested ranges are intact. The expected behavior should be all the covered ranges to be handled.

All the patches are tested by modified user space code and the code logic works as expected. The modified user space testing code is provided in the last patch. The testing code is an example how the improved code is tested.

The whole change is divided into 6 patches to make the code review more clear and easier. If people prefer, I'd like to post a single large patch finally after the code review accomplished.

Please review the code and response. Thank you all in advance.

Coly Li

Cc Dan Williams <[email protected]>
Cc Geliang Tang <[email protected]>
Cc Hannes Reinecke <[email protected]>
Cc Jens Axboe <[email protected]>
Cc NeilBrown <[email protected]>
Cc Richard Fan <[email protected]>
Cc Vishal L Verma <[email protected]>
Cc Wols Lists <[email protected]>
Cc Xiao Ni <[email protected]>

---

Coly Li (6):
badblocks: add more helper structure and routines in badblocks.h
badblocks: add helper routines for badblock ranges handling
badblocks: improve badblocks_set() for multiple ranges handling
badblocks: improve badblocks_clear() for multiple ranges handling
badblocks: improve badblocks_check() for multiple ranges handling
badblocks: switch to the improved badblock handling code

 block/badblocks.c         | 1609 ++++++++++++++++++++++++++++++-------
 include/linux/badblocks.h |   30 +
 2 files changed, 1345 insertions(+), 294 deletions(-)
Signature · 1 line
2.35.3