* [PATCH RESEND] raid5: fix duplicate checks for rdev->saved_raid_disk
@ 2022-07-16 3:11 Jackie Liu
2022-07-17 5:31 ` Song Liu
0 siblings, 1 reply; 7+ messages in thread
From: Jackie Liu @ 2022-07-16 3:11 UTC (permalink / raw)
To: song; +Cc: linux-raid, liu.yun
From: Jackie Liu <liuyun01@kylinos.cn>
'first' will always be greater than or equal to 0, it is unnecessary to
repeat the 0 check, clean it up.
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
---
drivers/md/raid5.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 20e53b167f81..a0b38a0ea9c3 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -8063,8 +8063,7 @@ static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev)
* find the disk ... but prefer rdev->saved_raid_disk
* if possible.
*/
- if (rdev->saved_raid_disk >= 0 &&
- rdev->saved_raid_disk >= first &&
+ if (rdev->saved_raid_disk >= first &&
rdev->saved_raid_disk <= last &&
conf->disks[rdev->saved_raid_disk].rdev == NULL)
first = rdev->saved_raid_disk;
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND] raid5: fix duplicate checks for rdev->saved_raid_disk
2022-07-16 3:11 [PATCH RESEND] raid5: fix duplicate checks for rdev->saved_raid_disk Jackie Liu
@ 2022-07-17 5:31 ` Song Liu
2022-07-18 0:39 ` Jackie Liu
2022-07-18 5:18 ` Jackie Liu
0 siblings, 2 replies; 7+ messages in thread
From: Song Liu @ 2022-07-17 5:31 UTC (permalink / raw)
To: Jackie Liu; +Cc: linux-raid
On Fri, Jul 15, 2022 at 8:11 PM Jackie Liu <liu.yun@linux.dev> wrote:
>
> From: Jackie Liu <liuyun01@kylinos.cn>
>
> 'first' will always be greater than or equal to 0, it is unnecessary to
> repeat the 0 check, clean it up.
>
> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
This looks identical to the original version. Which branch is this based on?
Please rebase on top of md-next branch and resend the patch:
https://git.kernel.org/pub/scm/linux/kernel/git/song/md.git/log/?h=md-next
Thanks,
Song
> ---
> drivers/md/raid5.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 20e53b167f81..a0b38a0ea9c3 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -8063,8 +8063,7 @@ static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev)
> * find the disk ... but prefer rdev->saved_raid_disk
> * if possible.
> */
> - if (rdev->saved_raid_disk >= 0 &&
> - rdev->saved_raid_disk >= first &&
> + if (rdev->saved_raid_disk >= first &&
> rdev->saved_raid_disk <= last &&
> conf->disks[rdev->saved_raid_disk].rdev == NULL)
> first = rdev->saved_raid_disk;
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND] raid5: fix duplicate checks for rdev->saved_raid_disk
2022-07-17 5:31 ` Song Liu
@ 2022-07-18 0:39 ` Jackie Liu
2022-07-18 5:18 ` Jackie Liu
1 sibling, 0 replies; 7+ messages in thread
From: Jackie Liu @ 2022-07-18 0:39 UTC (permalink / raw)
To: Song Liu; +Cc: linux-raid
Hi Song.
在 2022/7/17 13:31, Song Liu 写道:
> On Fri, Jul 15, 2022 at 8:11 PM Jackie Liu <liu.yun@linux.dev> wrote:
>>
>> From: Jackie Liu <liuyun01@kylinos.cn>
>>
>> 'first' will always be greater than or equal to 0, it is unnecessary to
>> repeat the 0 check, clean it up.
>>
>> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
>
> This looks identical to the original version. Which branch is this based on?
I based on linux.git/v5.19-rc7, it's linus tree.
> Please rebase on top of md-next branch and resend the patch:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/song/md.git/log/?h=md-next
Sure. will send new patch base this branch.
>
> Thanks,
> Song
>
>> ---
>> drivers/md/raid5.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
>> index 20e53b167f81..a0b38a0ea9c3 100644
>> --- a/drivers/md/raid5.c
>> +++ b/drivers/md/raid5.c
>> @@ -8063,8 +8063,7 @@ static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev)
>> * find the disk ... but prefer rdev->saved_raid_disk
>> * if possible.
>> */
>> - if (rdev->saved_raid_disk >= 0 &&
>> - rdev->saved_raid_disk >= first &&
>> + if (rdev->saved_raid_disk >= first &&
>> rdev->saved_raid_disk <= last &&
>> conf->disks[rdev->saved_raid_disk].rdev == NULL)
>> first = rdev->saved_raid_disk;
>> --
>> 2.25.1
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND] raid5: fix duplicate checks for rdev->saved_raid_disk
2022-07-17 5:31 ` Song Liu
2022-07-18 0:39 ` Jackie Liu
@ 2022-07-18 5:18 ` Jackie Liu
2022-07-18 6:08 ` Song Liu
1 sibling, 1 reply; 7+ messages in thread
From: Jackie Liu @ 2022-07-18 5:18 UTC (permalink / raw)
To: Song Liu; +Cc: linux-raid
Hi, Song.
在 2022/7/17 13:31, Song Liu 写道:
> On Fri, Jul 15, 2022 at 8:11 PM Jackie Liu <liu.yun@linux.dev> wrote:
>>
>> From: Jackie Liu <liuyun01@kylinos.cn>
>>
>> 'first' will always be greater than or equal to 0, it is unnecessary to
>> repeat the 0 check, clean it up.
>>
>> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
>
> This looks identical to the original version. Which branch is this based on?
> Please rebase on top of md-next branch and resend the patch:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/song/md.git/log/?h=md-next
>
The md-next branch is lower than the upstream version, v5.19-rc5
adds a patch.
commit 617b365872a247480e9dcd50a32c8d1806b21861
Author: Mikulas Patocka <mpatocka@redhat.com>
Date: Wed Jun 29 13:40:57 2022 -0400
dm raid: fix KASAN warning in raid5_add_disks
There's a KASAN warning in raid5_add_disk when running the LVM
testsuite.
The warning happens in the test
lvconvert-raid-reshape-linear_to_raid6-single-type.sh. We fix the
warning
by verifying that rdev->saved_raid_disk is within limits.
Cc: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index ba289411f26f..20e53b167f81 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -8065,6 +8065,7 @@ static int raid5_add_disk(struct mddev *mddev,
struct md_rdev *rdev)
*/
if (rdev->saved_raid_disk >= 0 &&
rdev->saved_raid_disk >= first &&
+ rdev->saved_raid_disk <= last &&
conf->disks[rdev->saved_raid_disk].rdev == NULL)
first = rdev->saved_raid_disk;
...
can you rebase from upstream? Thanks.
--
Jackie
> Thanks,
> Song
>
>> ---
>> drivers/md/raid5.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
>> index 20e53b167f81..a0b38a0ea9c3 100644
>> --- a/drivers/md/raid5.c
>> +++ b/drivers/md/raid5.c
>> @@ -8063,8 +8063,7 @@ static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev)
>> * find the disk ... but prefer rdev->saved_raid_disk
>> * if possible.
>> */
>> - if (rdev->saved_raid_disk >= 0 &&
>> - rdev->saved_raid_disk >= first &&
>> + if (rdev->saved_raid_disk >= first &&
>> rdev->saved_raid_disk <= last &&
>> conf->disks[rdev->saved_raid_disk].rdev == NULL)
>> first = rdev->saved_raid_disk;
>> --
>> 2.25.1
>>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND] raid5: fix duplicate checks for rdev->saved_raid_disk
2022-07-18 5:18 ` Jackie Liu
@ 2022-07-18 6:08 ` Song Liu
2022-07-19 18:45 ` Song Liu
0 siblings, 1 reply; 7+ messages in thread
From: Song Liu @ 2022-07-18 6:08 UTC (permalink / raw)
To: Jackie Liu; +Cc: linux-raid
On Sun, Jul 17, 2022 at 10:19 PM Jackie Liu <liu.yun@linux.dev> wrote:
>
> Hi, Song.
>
> 在 2022/7/17 13:31, Song Liu 写道:
> > On Fri, Jul 15, 2022 at 8:11 PM Jackie Liu <liu.yun@linux.dev> wrote:
> >>
> >> From: Jackie Liu <liuyun01@kylinos.cn>
> >>
> >> 'first' will always be greater than or equal to 0, it is unnecessary to
> >> repeat the 0 check, clean it up.
> >>
> >> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
> >
> > This looks identical to the original version. Which branch is this based on?
> > Please rebase on top of md-next branch and resend the patch:
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/song/md.git/log/?h=md-next
> >
>
> The md-next branch is lower than the upstream version, v5.19-rc5
> adds a patch.
>
> commit 617b365872a247480e9dcd50a32c8d1806b21861
> Author: Mikulas Patocka <mpatocka@redhat.com>
> Date: Wed Jun 29 13:40:57 2022 -0400
>
> dm raid: fix KASAN warning in raid5_add_disks
>
> There's a KASAN warning in raid5_add_disk when running the LVM
> testsuite.
> The warning happens in the test
> lvconvert-raid-reshape-linear_to_raid6-single-type.sh. We fix the
> warning
> by verifying that rdev->saved_raid_disk is within limits.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
>
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index ba289411f26f..20e53b167f81 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -8065,6 +8065,7 @@ static int raid5_add_disk(struct mddev *mddev,
> struct md_rdev *rdev)
> */
> if (rdev->saved_raid_disk >= 0 &&
> rdev->saved_raid_disk >= first &&
> + rdev->saved_raid_disk <= last &&
> conf->disks[rdev->saved_raid_disk].rdev == NULL)
> first = rdev->saved_raid_disk;
>
> ...
> can you rebase from upstream? Thanks.
ah, I see. Now it works. No need to resend.
Thanks,
Song
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND] raid5: fix duplicate checks for rdev->saved_raid_disk
2022-07-18 6:08 ` Song Liu
@ 2022-07-19 18:45 ` Song Liu
2022-07-20 0:23 ` Jackie Liu
0 siblings, 1 reply; 7+ messages in thread
From: Song Liu @ 2022-07-19 18:45 UTC (permalink / raw)
To: Jackie Liu; +Cc: linux-raid
Hi Jackie,
As suggested by Jens, I will postpone this fix until after the merge window.
Thanks,
Song
On Sun, Jul 17, 2022 at 11:08 PM Song Liu <song@kernel.org> wrote:
>
> On Sun, Jul 17, 2022 at 10:19 PM Jackie Liu <liu.yun@linux.dev> wrote:
> >
> > Hi, Song.
> >
> > 在 2022/7/17 13:31, Song Liu 写道:
> > > On Fri, Jul 15, 2022 at 8:11 PM Jackie Liu <liu.yun@linux.dev> wrote:
> > >>
> > >> From: Jackie Liu <liuyun01@kylinos.cn>
> > >>
> > >> 'first' will always be greater than or equal to 0, it is unnecessary to
> > >> repeat the 0 check, clean it up.
> > >>
> > >> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
> > >
> > > This looks identical to the original version. Which branch is this based on?
> > > Please rebase on top of md-next branch and resend the patch:
> > >
> > > https://git.kernel.org/pub/scm/linux/kernel/git/song/md.git/log/?h=md-next
> > >
> >
> > The md-next branch is lower than the upstream version, v5.19-rc5
> > adds a patch.
> >
> > commit 617b365872a247480e9dcd50a32c8d1806b21861
> > Author: Mikulas Patocka <mpatocka@redhat.com>
> > Date: Wed Jun 29 13:40:57 2022 -0400
> >
> > dm raid: fix KASAN warning in raid5_add_disks
> >
> > There's a KASAN warning in raid5_add_disk when running the LVM
> > testsuite.
> > The warning happens in the test
> > lvconvert-raid-reshape-linear_to_raid6-single-type.sh. We fix the
> > warning
> > by verifying that rdev->saved_raid_disk is within limits.
> >
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> > Signed-off-by: Mike Snitzer <snitzer@kernel.org>
> >
> > diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> > index ba289411f26f..20e53b167f81 100644
> > --- a/drivers/md/raid5.c
> > +++ b/drivers/md/raid5.c
> > @@ -8065,6 +8065,7 @@ static int raid5_add_disk(struct mddev *mddev,
> > struct md_rdev *rdev)
> > */
> > if (rdev->saved_raid_disk >= 0 &&
> > rdev->saved_raid_disk >= first &&
> > + rdev->saved_raid_disk <= last &&
> > conf->disks[rdev->saved_raid_disk].rdev == NULL)
> > first = rdev->saved_raid_disk;
> >
> > ...
> > can you rebase from upstream? Thanks.
>
> ah, I see. Now it works. No need to resend.
>
> Thanks,
> Song
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND] raid5: fix duplicate checks for rdev->saved_raid_disk
2022-07-19 18:45 ` Song Liu
@ 2022-07-20 0:23 ` Jackie Liu
0 siblings, 0 replies; 7+ messages in thread
From: Jackie Liu @ 2022-07-20 0:23 UTC (permalink / raw)
To: Song Liu; +Cc: linux-raid
Hi Song.
It's fine. Thanks.
--
Jackie Liu
在 2022/7/20 02:45, Song Liu 写道:
> Hi Jackie,
>
> As suggested by Jens, I will postpone this fix until after the merge window.
>
> Thanks,
> Song
>
> On Sun, Jul 17, 2022 at 11:08 PM Song Liu <song@kernel.org> wrote:
>>
>> On Sun, Jul 17, 2022 at 10:19 PM Jackie Liu <liu.yun@linux.dev> wrote:
>>>
>>> Hi, Song.
>>>
>>> 在 2022/7/17 13:31, Song Liu 写道:
>>>> On Fri, Jul 15, 2022 at 8:11 PM Jackie Liu <liu.yun@linux.dev> wrote:
>>>>>
>>>>> From: Jackie Liu <liuyun01@kylinos.cn>
>>>>>
>>>>> 'first' will always be greater than or equal to 0, it is unnecessary to
>>>>> repeat the 0 check, clean it up.
>>>>>
>>>>> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
>>>>
>>>> This looks identical to the original version. Which branch is this based on?
>>>> Please rebase on top of md-next branch and resend the patch:
>>>>
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/song/md.git/log/?h=md-next
>>>>
>>>
>>> The md-next branch is lower than the upstream version, v5.19-rc5
>>> adds a patch.
>>>
>>> commit 617b365872a247480e9dcd50a32c8d1806b21861
>>> Author: Mikulas Patocka <mpatocka@redhat.com>
>>> Date: Wed Jun 29 13:40:57 2022 -0400
>>>
>>> dm raid: fix KASAN warning in raid5_add_disks
>>>
>>> There's a KASAN warning in raid5_add_disk when running the LVM
>>> testsuite.
>>> The warning happens in the test
>>> lvconvert-raid-reshape-linear_to_raid6-single-type.sh. We fix the
>>> warning
>>> by verifying that rdev->saved_raid_disk is within limits.
>>>
>>> Cc: stable@vger.kernel.org
>>> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
>>> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
>>>
>>> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
>>> index ba289411f26f..20e53b167f81 100644
>>> --- a/drivers/md/raid5.c
>>> +++ b/drivers/md/raid5.c
>>> @@ -8065,6 +8065,7 @@ static int raid5_add_disk(struct mddev *mddev,
>>> struct md_rdev *rdev)
>>> */
>>> if (rdev->saved_raid_disk >= 0 &&
>>> rdev->saved_raid_disk >= first &&
>>> + rdev->saved_raid_disk <= last &&
>>> conf->disks[rdev->saved_raid_disk].rdev == NULL)
>>> first = rdev->saved_raid_disk;
>>>
>>> ...
>>> can you rebase from upstream? Thanks.
>>
>> ah, I see. Now it works. No need to resend.
>>
>> Thanks,
>> Song
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-07-20 0:23 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-16 3:11 [PATCH RESEND] raid5: fix duplicate checks for rdev->saved_raid_disk Jackie Liu
2022-07-17 5:31 ` Song Liu
2022-07-18 0:39 ` Jackie Liu
2022-07-18 5:18 ` Jackie Liu
2022-07-18 6:08 ` Song Liu
2022-07-19 18:45 ` Song Liu
2022-07-20 0:23 ` Jackie Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).