mbox series

[V2,00/12] badblocks: bugfix and cleanup for badblocks

Message ID 20250227075507.151331-1-zhengqixing@huaweicloud.com (mailing list archive)
Headers show
Series badblocks: bugfix and cleanup for badblocks | expand

Message

Zheng Qixing Feb. 27, 2025, 7:54 a.m. UTC
From: Zheng Qixing <zhengqixing@huawei.com>

Hi,

during RAID feature implementation testing, we found several bugs
in badblocks.

This series contains bugfixes and cleanups for MD RAID badblocks
handling code.

V2:
        - patch 4: add a description of the issue
        - patch 5: add comment of parital setting
        - patch 6: add fix tag
        - patch 10: two code style modifications
        - patch 11: keep original functionality of rdev_clear_badblocks(),
          functionality was incorrectly modified in V1.
	- patch 1-10 and patch 12 are reviewed by Yu Kuai
	  <yukuai3@huawei.com>
	- patch 1, 3, 5, 6, 8, 9, 10, 12 are acked by Coly Li
	  <colyli@kernel.org>

Li Nan (8):
  badblocks: Fix error shitf ops
  badblocks: factor out a helper try_adjacent_combine
  badblocks: attempt to merge adjacent badblocks during
    ack_all_badblocks
  badblocks: return error directly when setting badblocks exceeds 512
  badblocks: return error if any badblock set fails
  badblocks: fix the using of MAX_BADBLOCKS
  badblocks: try can_merge_front before overlap_front
  badblocks: fix merge issue when new badblocks align with pre+1

Zheng Qixing (4):
  badblocks: fix missing bad blocks on retry in _badblocks_check()
  badblocks: return boolean from badblocks_set() and badblocks_clear()
  md: improve return types of badblocks handling functions
  badblocks: use sector_t instead of int to avoid truncation of
    badblocks length

 block/badblocks.c             | 322 +++++++++++++---------------------
 drivers/block/null_blk/main.c |  16 +-
 drivers/md/md.c               |  48 ++---
 drivers/md/md.h               |  14 +-
 drivers/md/raid1-10.c         |   2 +-
 drivers/md/raid1.c            |  10 +-
 drivers/md/raid10.c           |  14 +-
 drivers/nvdimm/badrange.c     |   2 +-
 drivers/nvdimm/nd.h           |   2 +-
 drivers/nvdimm/pfn_devs.c     |   7 +-
 drivers/nvdimm/pmem.c         |   2 +-
 include/linux/badblocks.h     |  10 +-
 12 files changed, 183 insertions(+), 266 deletions(-)

Comments

Yu Kuai March 5, 2025, 1:41 a.m. UTC | #1
Hi, Jens!

在 2025/02/27 15:54, Zheng Qixing 写道:
> From: Zheng Qixing <zhengqixing@huawei.com>
> 
> Hi,
> 
> during RAID feature implementation testing, we found several bugs
> in badblocks.
> 
> This series contains bugfixes and cleanups for MD RAID badblocks
> handling code.
> 
> V2:
>          - patch 4: add a description of the issue
>          - patch 5: add comment of parital setting
>          - patch 6: add fix tag
>          - patch 10: two code style modifications
>          - patch 11: keep original functionality of rdev_clear_badblocks(),
>            functionality was incorrectly modified in V1.
> 	- patch 1-10 and patch 12 are reviewed by Yu Kuai
> 	  <yukuai3@huawei.com>
> 	- patch 1, 3, 5, 6, 8, 9, 10, 12 are acked by Coly Li
> 	  <colyli@kernel.org>
> 
> Li Nan (8):
>    badblocks: Fix error shitf ops
>    badblocks: factor out a helper try_adjacent_combine
>    badblocks: attempt to merge adjacent badblocks during
>      ack_all_badblocks
>    badblocks: return error directly when setting badblocks exceeds 512
>    badblocks: return error if any badblock set fails
>    badblocks: fix the using of MAX_BADBLOCKS
>    badblocks: try can_merge_front before overlap_front
>    badblocks: fix merge issue when new badblocks align with pre+1
> 
> Zheng Qixing (4):
>    badblocks: fix missing bad blocks on retry in _badblocks_check()
>    badblocks: return boolean from badblocks_set() and badblocks_clear()
>    md: improve return types of badblocks handling functions
>    badblocks: use sector_t instead of int to avoid truncation of
>      badblocks length
> 

This set contains fixes that are found by testing mdraid, please
consider this set for the next merge window, or I can apply it to
md-6.15.

Thanks,
Kuai

>   block/badblocks.c             | 322 +++++++++++++---------------------
>   drivers/block/null_blk/main.c |  16 +-
>   drivers/md/md.c               |  48 ++---
>   drivers/md/md.h               |  14 +-
>   drivers/md/raid1-10.c         |   2 +-
>   drivers/md/raid1.c            |  10 +-
>   drivers/md/raid10.c           |  14 +-
>   drivers/nvdimm/badrange.c     |   2 +-
>   drivers/nvdimm/nd.h           |   2 +-
>   drivers/nvdimm/pfn_devs.c     |   7 +-
>   drivers/nvdimm/pmem.c         |   2 +-
>   include/linux/badblocks.h     |  10 +-
>   12 files changed, 183 insertions(+), 266 deletions(-)
>
Jens Axboe March 6, 2025, 3:05 p.m. UTC | #2
On Thu, 27 Feb 2025 15:54:55 +0800, Zheng Qixing wrote:
> during RAID feature implementation testing, we found several bugs
> in badblocks.
> 
> This series contains bugfixes and cleanups for MD RAID badblocks
> handling code.
> 
> V2:
>         - patch 4: add a description of the issue
>         - patch 5: add comment of parital setting
>         - patch 6: add fix tag
>         - patch 10: two code style modifications
>         - patch 11: keep original functionality of rdev_clear_badblocks(),
>           functionality was incorrectly modified in V1.
> 	- patch 1-10 and patch 12 are reviewed by Yu Kuai
> 	  <yukuai3@huawei.com>
> 	- patch 1, 3, 5, 6, 8, 9, 10, 12 are acked by Coly Li
> 	  <colyli@kernel.org>
> 
> [...]

Applied, thanks!

[01/12] badblocks: Fix error shitf ops
        commit: 7d83c5d73c1a3c7b71ba70d0ad2ae66e7a0e7ace
[02/12] badblocks: factor out a helper try_adjacent_combine
        commit: 270b68fee9688428e0a98d4a2c3e6d4c434a84ba
[03/12] badblocks: attempt to merge adjacent badblocks during ack_all_badblocks
        commit: 32e9ad4d11f69949ff331e35a417871ee0d31d99
[04/12] badblocks: return error directly when setting badblocks exceeds 512
        commit: 28243dcd1f49cc8be398a1396d16a45527882ce5
[05/12] badblocks: return error if any badblock set fails
        commit: 7f500f0a59b1d7345a05ec4ae703babf34b7e470
[06/12] badblocks: fix the using of MAX_BADBLOCKS
        commit: 37446680dfbfbba7cbedd680047182f70a0b857b
[07/12] badblocks: try can_merge_front before overlap_front
        commit: 3a23d05f9c1abf8238fe48167ab5574062d1606e
[08/12] badblocks: fix merge issue when new badblocks align with pre+1
        commit: 9ec65dec634a752ab0a1203510ee190356e4cf1a
[09/12] badblocks: fix missing bad blocks on retry in _badblocks_check()
        commit: 5236f041fa6c81c71eabad44897e54a0d6d5bbf6
[10/12] badblocks: return boolean from badblocks_set() and badblocks_clear()
        commit: c8775aefba959cdfbaa25408a84d3dd15bbeb991
[11/12] md: improve return types of badblocks handling functions
        commit: 7e5102dd99f3ad1f981671ad5b4f24ac48c568ad
[12/12] badblocks: use sector_t instead of int to avoid truncation of badblocks length
        commit: d301f164c3fbff611bd71f57dfa553b9219f0f5e

Best regards,