* [PATCH 000 of 2] md: bug fixes for 2.6.23-rc
@ 2007-08-16 0:38 NeilBrown
2007-08-16 0:38 ` [PATCH 001 of 2] md: Make sure a re-add after a restart honours bitmap when resyncing NeilBrown
2007-08-16 0:38 ` [PATCH 002 of 2] md: Correctly update sysfs when a raid1 is reshaped NeilBrown
0 siblings, 2 replies; 3+ messages in thread
From: NeilBrown @ 2007-08-16 0:38 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-raid, linux-kernel
Following 2 patches contain bugfixes for md. Both apply to earlier
kernels, but probably aren't significant enough for -stable (no oops,
no data corruption, no security hole).
They should go in 2.6.23 though.
Thanks,
NeilBrown
[PATCH 001 of 2] md: Make sure a re-add after a restart honours bitmap when resyncing.
[PATCH 002 of 2] md: Correctly update sysfs when a raid1 is reshaped.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 001 of 2] md: Make sure a re-add after a restart honours bitmap when resyncing.
2007-08-16 0:38 [PATCH 000 of 2] md: bug fixes for 2.6.23-rc NeilBrown
@ 2007-08-16 0:38 ` NeilBrown
2007-08-16 0:38 ` [PATCH 002 of 2] md: Correctly update sysfs when a raid1 is reshaped NeilBrown
1 sibling, 0 replies; 3+ messages in thread
From: NeilBrown @ 2007-08-16 0:38 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-raid, linux-kernel
Commit 1757128438d41670ded8bc3bc735325cc07dc8f9 was slightly bad. If
an array has a write-intent bitmap, and you remove a drive, then readd
it, only the changed parts should be resynced. However after the
above commit, this only works if the array has not been shut down and
restarted.
This is because it sets 'fullsync' at little more often
than it should. This patch is more careful.
Signed-off-by: Neil Brown <neilb@suse.de>
### Diffstat output
./drivers/md/raid1.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff .prev/drivers/md/raid1.c ./drivers/md/raid1.c
--- .prev/drivers/md/raid1.c 2007-08-16 10:27:57.000000000 +1000
+++ ./drivers/md/raid1.c 2007-08-16 10:27:57.000000000 +1000
@@ -1972,7 +1972,8 @@ static int run(mddev_t *mddev)
!test_bit(In_sync, &disk->rdev->flags)) {
disk->head_position = 0;
mddev->degraded++;
- conf->fullsync = 1;
+ if (disk->rdev)
+ conf->fullsync = 1;
}
}
if (mddev->degraded == conf->raid_disks) {
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH 002 of 2] md: Correctly update sysfs when a raid1 is reshaped.
2007-08-16 0:38 [PATCH 000 of 2] md: bug fixes for 2.6.23-rc NeilBrown
2007-08-16 0:38 ` [PATCH 001 of 2] md: Make sure a re-add after a restart honours bitmap when resyncing NeilBrown
@ 2007-08-16 0:38 ` NeilBrown
1 sibling, 0 replies; 3+ messages in thread
From: NeilBrown @ 2007-08-16 0:38 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-raid, linux-kernel
When a raid1 array is reshaped (number of drives changed),
the list of devices is compacted, so that slots for missing
devices are filled with working devices from later slots.
This requires the "rd%d" symlinks in sysfs to be updated.
Signed-off-by: Neil Brown <neilb@suse.de>
### Diffstat output
./drivers/md/raid1.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff .prev/drivers/md/raid1.c ./drivers/md/raid1.c
--- .prev/drivers/md/raid1.c 2007-08-16 10:27:57.000000000 +1000
+++ ./drivers/md/raid1.c 2007-08-16 10:29:58.000000000 +1000
@@ -2154,11 +2154,25 @@ static int raid1_reshape(mddev_t *mddev)
oldpool = conf->r1bio_pool;
conf->r1bio_pool = newpool;
- for (d=d2=0; d < conf->raid_disks; d++)
- if (conf->mirrors[d].rdev) {
- conf->mirrors[d].rdev->raid_disk = d2;
- newmirrors[d2++].rdev = conf->mirrors[d].rdev;
+ for (d = d2 = 0; d < conf->raid_disks; d++) {
+ mdk_rdev_t *rdev = conf->mirrors[d].rdev;
+ if (rdev && rdev->raid_disk != d2) {
+ char nm[20];
+ sprintf(nm, "rd%d", rdev->raid_disk);
+ sysfs_remove_link(&mddev->kobj, nm);
+ rdev->raid_disk = d2;
+ sprintf(nm, "rd%d", rdev->raid_disk);
+ sysfs_remove_link(&mddev->kobj, nm);
+ if (sysfs_create_link(&mddev->kobj,
+ &rdev->kobj, nm))
+ printk(KERN_WARNING
+ "md/raid1: cannot register "
+ "%s for %s\n",
+ nm, mdname(mddev));
}
+ if (rdev)
+ newmirrors[d2++].rdev = rdev;
+ }
kfree(conf->mirrors);
conf->mirrors = newmirrors;
kfree(conf->poolinfo);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-16 0:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-16 0:38 [PATCH 000 of 2] md: bug fixes for 2.6.23-rc NeilBrown
2007-08-16 0:38 ` [PATCH 001 of 2] md: Make sure a re-add after a restart honours bitmap when resyncing NeilBrown
2007-08-16 0:38 ` [PATCH 002 of 2] md: Correctly update sysfs when a raid1 is reshaped NeilBrown
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).