lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 6 Nov 2018 08:37:32 +0100
From:   Jack Wang <jack.wang.usish@...il.com>
To:     sashal@...nel.org
Cc:     stable@...r.kernel.org, linux-kernel@...r.kernel.org, shli@...com
Subject: Re: [PATCH AUTOSEL 4.19 118/146] MD: fix invalid stored role for a disk

Sasha Levin <sashal@...nel.org> 于2018年11月1日周四 上午12:45写道:
>
> From: Shaohua Li <shli@...com>
>
> [ Upstream commit d595567dc4f0c1d90685ec1e2e296e2cad2643ac ]
>
> If we change the number of array's device after device is removed from array,
> then add the device back to array, we can see that device is added as active
> role instead of spare which we expected.
>
> Please see the below link for details:
> https://marc.info/?l=linux-raid&m=153736982015076&w=2
>
> This is caused by that we prefer to use device's previous role which is
> recorded by saved_raid_disk, but we should respect the new number of
> conf->raid_disks since it could be changed after device is removed.
>
> Reported-by: Gioh Kim <gi-oh.kim@...fitbricks.com>
> Tested-by: Gioh Kim <gi-oh.kim@...fitbricks.com>
> Acked-by: Guoqing Jiang <gqjiang@...e.com>9e753ba9b9b405e3902d9f08aec5f2ea58a0c317
> Signed-off-by: Shaohua Li <shli@...com>
> Signed-off-by: Sasha Levin <sashal@...nel.org>
Hi Sasha,

This patch breaks linear hotadd please also include  commit
9e753ba9b9b405e3902d9f08aec5f2ea58a0c317
MD: fix invalid stored role for a disk - try2

Regards,
Jack Wang

> ---
>  drivers/md/md.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 8668793262d0..85459c17cc60 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -1776,6 +1776,10 @@ static int super_1_validate(struct mddev *mddev, struct md_rdev *rdev)
>                         } else
>                                 set_bit(In_sync, &rdev->flags);
>                         rdev->raid_disk = role;
> +                       if (role >= mddev->raid_disks) {
> +                               rdev->saved_raid_disk = -1;
> +                               rdev->raid_disk = -1;
> +                       }
>                         break;
>                 }
>                 if (sb->devflags & WriteMostly1)
> --
> 2.17.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ