Messages in this thread | | | Date | Sun, 14 May 2023 19:08:03 +0800 | Subject | Re: [PATCH v2 3/4] md/raid10: fix wrong setting of max_corr_read_errors | From | Li Nan <> |
| |
在 2023/5/13 10:21, Yu Kuai 写道: > Hi, > > 在 2023/05/13 9:08, Song Liu 写道: >> On Fri, May 5, 2023 at 7:02 PM Yu Kuai <yukuai1@huaweicloud.com> wrote: >>> >>> Hi, >>> >>> 在 2023/05/06 9:23, linan666@huaweicloud.com 写道: >>>> From: Li Nan <linan122@huawei.com> >>>> >>>> max_corr_read_errors should not be negative number. Change it to >>>> unsigned int where use it. >>>> >>> >>> Looks good, feel free to add: >>> >>> Reviewed-by: Yu Kuai <yukuai3@huawei.com> >>> >>>> Fixes: 1e50915fe0bb ("raid: improve MD/raid10 handling of >>>> correctable read errors.") >>>> Signed-off-by: Li Nan <linan122@huawei.com> >> >> Hmm.. Does the current code break in any cases? > > The problem is that somewhere use unsigned value, and somewhere use > signed value, and I thinsk the only functional change is in > fix_read_error(), if max_read_errors is negative, the judgement will > always pass before this patch: > > if (atomic_read(&rdev->read_errors) > max_read_errors) >
In addition, it is confusing for users after setting a huge number to it. # echo 4294967295 > /sys/block/$disk/md/max_read_errors # cat /sys/block/$disk/md/max_read_errors -1
-- Thanks, Nan
| |