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:	Sun, 17 Nov 2013 04:11:19 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Pawel Baldysiak <pawel.baldysiak@...el.com>,
	Lukasz Dorau <lukasz.dorau@...el.com>,
	NeilBrown <neilb@...e.de>
Cc:	linux-kernel@...r.kernel.org, stable@...r.kernel.org,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH 3.4 11/26] md: Fix skipping recovery for read-only
 arrays.

On Fri, 2013-11-08 at 22:51 -0800, Greg Kroah-Hartman wrote:
> 3.4-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Lukasz Dorau <lukasz.dorau@...el.com>
> 
> commit 61e4947c99c4494336254ec540c50186d186150b upstream.
> 
> Since:
>         commit 7ceb17e87bde79d285a8b988cfed9eaeebe60b86
>         md: Allow devices to be re-added to a read-only array.
> 
> spares are activated on a read-only array. In case of raid1 and raid10
> personalities it causes that not-in-sync devices are marked in-sync
> without checking if recovery has been finished.
> 
> If a read-only array is degraded and one of its devices is not in-sync
> (because the array has been only partially recovered) recovery will be skipped.
> 
> This patch adds checking if recovery has been finished before marking a device
> in-sync for raid1 and raid10 personalities. In case of raid5 personality
> such condition is already present (at raid5.c:6029).
> 
> Bug was introduced in 3.10 and causes data corruption.

So this fix was not needed for 3.4.  Is it harmful if applied to this
version?

Ben.

> Signed-off-by: Pawel Baldysiak <pawel.baldysiak@...el.com>
> Signed-off-by: Lukasz Dorau <lukasz.dorau@...el.com>
> Signed-off-by: NeilBrown <neilb@...e.de>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> 
> ---
>  drivers/md/raid1.c  |    1 +
>  drivers/md/raid10.c |    1 +
>  2 files changed, 2 insertions(+)
> 
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -1357,6 +1357,7 @@ static int raid1_spare_active(struct mdd
>  			}
>  		}
>  		if (rdev
> +		    && rdev->recovery_offset == MaxSector
>  		    && !test_bit(Faulty, &rdev->flags)
>  		    && !test_and_set_bit(In_sync, &rdev->flags)) {
>  			count++;
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -1534,6 +1534,7 @@ static int raid10_spare_active(struct md
>  			}
>  			sysfs_notify_dirent_safe(tmp->replacement->sysfs_state);
>  		} else if (tmp->rdev
> +			   && tmp->rdev->recovery_offset == MaxSector
>  			   && !test_bit(Faulty, &tmp->rdev->flags)
>  			   && !test_and_set_bit(In_sync, &tmp->rdev->flags)) {
>  			count++;

-- 
Ben Hutchings
Beware of bugs in the above code;
I have only proved it correct, not tried it. - Donald Knuth

Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists