]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/0008-md-be-more-consistent-about-setting-WriteMostly-flag.patch
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / 0008-md-be-more-consistent-about-setting-WriteMostly-flag.patch
CommitLineData
2cb7cef9
BS
1From 575a80fa4f623141e9791e41879d87800fb6d862 Mon Sep 17 00:00:00 2001
2From: NeilBrown <neilb@suse.de>
3Date: Tue, 31 Mar 2009 14:33:13 +1100
4Subject: [PATCH] md: be more consistent about setting WriteMostly flag when adding a drive to an array
5
6When a drive is added to an array using ADD_NEW_DISK, there are two
7places we can get certain flags from: the metadata on the disk or the
8flags passed through the IOCTL.
9
10For the WriteMostly flag (aka MD_DISK_WRITEMOSTLY) we take the value
11from either of those sources depending on if it is set (i.e. we
12effectively 'or' the two sources together).
13
14This makes it awkward to clear, and is at best inconsistent.
15
16As documented code (in mdadm) requires that setting
17MD_DISK_WRITEMOSTLY in the ioctl will be effective, we resolve the
18inconsistency by always using the value for this flag from the ioctl,
19and ignoring the value on disk.
20
21
22Signed-off-by: NeilBrown <neilb@suse.de>
23---
24 drivers/md/md.c | 2 ++
25 1 file changed, 2 insertions(+)
26
27--- linux-2.6.27-SLE11_BRANCH.orig/drivers/md/md.c
28+++ linux-2.6.27-SLE11_BRANCH/drivers/md/md.c
29@@ -4351,6 +4351,8 @@ static int add_new_disk(mddev_t * mddev,
30 clear_bit(In_sync, &rdev->flags); /* just to be sure */
31 if (info->state & (1<<MD_DISK_WRITEMOSTLY))
32 set_bit(WriteMostly, &rdev->flags);
33+ else
34+ clear_bit(WriteMostly, &rdev->flags);
35
36 rdev->raid_disk = -1;
37 err = bind_rdev_to_array(rdev, mddev);