From: Greg Kroah-Hartman Date: Thu, 6 Aug 2009 20:45:49 +0000 (-0700) Subject: fixed md patch for .30 X-Git-Tag: v2.6.30.5~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ceafdfcef277ef96386b41b40020257c882b487e;p=thirdparty%2Fkernel%2Fstable-queue.git fixed md patch for .30 --- diff --git a/queue-2.6.30/md-handle-growth-of-v1.x-metadata-correctly.patch b/queue-2.6.30/md-handle-growth-of-v1.x-metadata-correctly.patch new file mode 100644 index 00000000000..915dee6273d --- /dev/null +++ b/queue-2.6.30/md-handle-growth-of-v1.x-metadata-correctly.patch @@ -0,0 +1,47 @@ +From neilb@suse.de Thu Aug 6 13:23:07 2009 +From: Neil Brown +Date: Thu, 6 Aug 2009 15:53:57 +1000 +Subject: md: Handle growth of v1.x metadata correctly. +To: Greg KH +Cc: stable@kernel.org +Message-ID: <19066.28661.194843.385976@notabene.brown> + + +From: Neil Brown + +commit 70471dafe3390243c598a3165dfb86b8b8b3f4fe upstream. + +The v1.x metadata does not have a fixed size and can grow +when devices are added. +If it grows enough to require an extra sector of storage, +we need to update the 'sb_size' to match. + +Without this, md can write out an incomplete superblock with a +bad checksum, which will be rejected when trying to re-assemble +the array. + +Signed-off-by: NeilBrown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/md.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/md/md.c ++++ b/drivers/md/md.c +@@ -1410,8 +1410,14 @@ static void super_1_sync(mddev_t *mddev, + if (rdev2->desc_nr+1 > max_dev) + max_dev = rdev2->desc_nr+1; + +- if (max_dev > le32_to_cpu(sb->max_dev)) ++ if (max_dev > le32_to_cpu(sb->max_dev)) { ++ int bmask; + sb->max_dev = cpu_to_le32(max_dev); ++ rdev->sb_size = max_dev * 2 + 256; ++ bmask = queue_hardsect_size(rdev->bdev->bd_disk->queue)-1; ++ if (rdev->sb_size & bmask) ++ rdev->sb_size = (rdev->sb_size | bmask) + 1; ++ } + for (i=0; idev_roles[i] = cpu_to_le16(0xfffe); + diff --git a/queue-2.6.30/series b/queue-2.6.30/series index f9ce2219738..333ed067d00 100644 --- a/queue-2.6.30/series +++ b/queue-2.6.30/series @@ -51,3 +51,4 @@ ieee1394-sbp2-add-support-for-disks-2-tb.patch atl1c-wake_mcast-tested-twice-not-wake_ucast.patch atl1c-add-missing-parentheses.patch atl1c-misplaced-parenthesis.patch +md-handle-growth-of-v1.x-metadata-correctly.patch