linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linux RAID Mailing List <linux-raid@vger.kernel.org>,
	Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: [patch] fixes for RAID1/RAID5 hot-add/hot-remove, 2.4.0-ac9
Date: Mon, 15 Jan 2001 12:51:23 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.30.0101151248200.1398-200000@e2> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 169 bytes --]


- the attached patch (against -ac9) fixes a bug in the RAID1 and RAID4/5
  code that made raidhotremove fail under certain (rare) circumstances.
  Please apply.

	Ingo

[-- Attachment #2: Type: TEXT/PLAIN, Size: 1444 bytes --]

--- linux/drivers/md/raid1.c.orig	Mon Dec 11 22:19:35 2000
+++ linux/drivers/md/raid1.c	Mon Jan 15 14:45:35 2001
@@ -832,6 +832,7 @@
 	struct mirror_info *tmp, *sdisk, *fdisk, *rdisk, *adisk;
 	mdp_super_t *sb = mddev->sb;
 	mdp_disk_t *failed_desc, *spare_desc, *added_desc;
+	mdk_rdev_t *spare_rdev, *failed_rdev;
 
 	print_raid1_conf(conf);
 	md_spin_lock_irq(&conf->device_lock);
@@ -989,6 +990,10 @@
 		/*
 		 * do the switch finally
 		 */
+		spare_rdev = find_rdev_nr(mddev, spare_desc->number);
+		failed_rdev = find_rdev_nr(mddev, failed_desc->number);
+		xchg_values(spare_rdev->desc_nr, failed_rdev->desc_nr);
+
 		xchg_values(*spare_desc, *failed_desc);
 		xchg_values(*fdisk, *sdisk);
 
--- linux/drivers/md/raid5.c.orig	Mon Jan 15 14:45:50 2001
+++ linux/drivers/md/raid5.c	Mon Jan 15 14:46:01 2001
@@ -1707,6 +1707,7 @@
 	struct disk_info *tmp, *sdisk, *fdisk, *rdisk, *adisk;
 	mdp_super_t *sb = mddev->sb;
 	mdp_disk_t *failed_desc, *spare_desc, *added_desc;
+	mdk_rdev_t *spare_rdev, *failed_rdev;
 
 	print_raid5_conf(conf);
 	md_spin_lock_irq(&conf->device_lock);
@@ -1878,6 +1879,10 @@
 		/*
 		 * do the switch finally
 		 */
+		spare_rdev = find_rdev_nr(mddev, spare_desc->number);
+		failed_rdev = find_rdev_nr(mddev, failed_desc->number);
+		xchg_values(spare_rdev->desc_nr, failed_rdev->desc_nr);
+
 		xchg_values(*spare_desc, *failed_desc);
 		xchg_values(*fdisk, *sdisk);
 

                 reply	other threads:[~2001-01-15 11:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.30.0101151248200.1398-200000@e2 \
    --to=mingo@elte.hu \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).