]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From 6d56e278444bc8323b1bcfcada126b8e4dbba0f4 Mon Sep 17 00:00:00 2001 |
2 | From: NeilBrown <neilb@suse.de> | |
3 | Date: Tue, 14 Apr 2009 12:01:57 +1000 | |
4 | Subject: [PATCH] md: allow setting newly added device to 'in_sync' via sysfs. | |
5 | ||
6 | When adding devices to an active array via sysfs, there is currently | |
7 | no way to mark a device as 'in-sync' which is useful when | |
8 | incrementally assembling an array. | |
9 | ||
10 | So add that option. | |
11 | ||
12 | Signed-off-by: NeilBrown <neilb@suse.de> | |
13 | --- | |
14 | drivers/md/md.c | 6 +++++- | |
15 | 1 file changed, 5 insertions(+), 1 deletion(-) | |
16 | ||
17 | --- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/md.c | |
18 | +++ linux-2.6.27-SLE11_BRANCH/drivers/md/md.c | |
19 | @@ -1950,6 +1950,7 @@ state_store(mdk_rdev_t *rdev, const char | |
20 | * -writemostly - clears write_mostly | |
21 | * blocked - sets the Blocked flag | |
22 | * -blocked - clears the Blocked flag | |
23 | + * insync - sets Insync providing device isn't active | |
24 | */ | |
25 | int err = -EINVAL; | |
26 | if (cmd_match(buf, "faulty") && rdev->mddev->pers) { | |
27 | @@ -1982,6 +1983,9 @@ state_store(mdk_rdev_t *rdev, const char | |
28 | md_wakeup_thread(rdev->mddev->thread); | |
29 | ||
30 | err = 0; | |
31 | + } else if (cmd_match(buf, "insync") && rdev->raid_disk == -1) { | |
32 | + set_bit(In_sync, &rdev->flags); | |
33 | + err = 0; | |
34 | } | |
35 | if (!err) | |
36 | sysfs_notify(&rdev->kobj, NULL, "state"); | |
37 | @@ -2055,7 +2059,7 @@ slot_store(mdk_rdev_t *rdev, const char | |
38 | mdk_rdev_t *rdev2; | |
39 | struct list_head *tmp; | |
40 | /* Activating a spare .. or possibly reactivating | |
41 | - * if we every get bitmaps working here. | |
42 | + * if we ever get bitmaps working here. | |
43 | */ | |
44 | ||
45 | if (rdev->raid_disk != -1) |