[PATCH 003 of 4] md: Fix up maintenance of ->degraded in multipath.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A recent fix which made sure ->degraded was initialised properly
exposed a second bug - ->degraded wasn't been updated when drives
failed or were hot-added.

Signed-off-by: Neil Brown <[email protected]>

### Diffstat output
 ./drivers/md/multipath.c |    2 ++
 1 file changed, 2 insertions(+)

diff .prev/drivers/md/multipath.c ./drivers/md/multipath.c
--- .prev/drivers/md/multipath.c	2006-10-23 16:34:54.000000000 +1000
+++ ./drivers/md/multipath.c	2006-10-23 16:35:38.000000000 +1000
@@ -277,6 +277,7 @@ static void multipath_error (mddev_t *md
 			set_bit(Faulty, &rdev->flags);
 			set_bit(MD_CHANGE_DEVS, &mddev->flags);
 			conf->working_disks--;
+			mddev->degraded++;
 			printk(KERN_ALERT "multipath: IO failure on %s,"
 				" disabling IO path. \n	Operation continuing"
 				" on %d IO paths.\n",
@@ -336,6 +337,7 @@ static int multipath_add_disk(mddev_t *m
 				blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9);
 
 			conf->working_disks++;
+			mddev->degraded--;
 			rdev->raid_disk = path;
 			set_bit(In_sync, &rdev->flags);
 			rcu_assign_pointer(p->rdev, rdev);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux