mdadm/mdadm-3.2.3-FIX-Detect-error-and-rollback-metadata.patch
Jes Sorensen 6148d71c1d Fix a large number of bzs:
- Fix Monitor mode sometimes crashes when a resync completes
- Fix missing symlink for mdadm container device when incremental creates
  the array
- Make sure when creating a second array in a container that the second
  array uses all available space since leaving space for a third array
  is invalid
- Validate the number of imsm volumes per controller
- Fix issues with imsm arrays and disks larger than 2TB
- Add support for expanding imsm arrays/containers
- The support for expanding imsm arrays/containers was accepted upstream,
  update to the official patches from there
- Fix for the issue of --add not being very smart
- Fix an issue causing rebuilds to fail to restart on reboot (data
  corrupter level problem)
- Reset the bad flag on map file updates
- Correctly fix failure when trying to add internal bitmap to 1.0 arrays
- Resolves: bz817023 (f17) bz817024 (f17) bz817026 (f17) bz817028 (f17)
- Resolves: bz817029 (f17) bz817032 (f17) bz817038 (f17) bz808774 (f17)
- Resolves: bz817039 (f17) bz817042 (f17)

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
2012-04-30 17:50:18 +02:00

63 lines
1.8 KiB
Diff

From 65a9798b58b4e4de0157043e2b30a738c27eff43 Mon Sep 17 00:00:00 2001
From: Adam Kwolek <adam.kwolek@intel.com>
Date: Fri, 13 Apr 2012 16:52:03 +0200
Subject: [PATCH 09/14] FIX: Detect error and rollback metadata
Some setting size error cases were not detected.
When error occurs, stop setting new size action and rollback metadata
changes.
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
---
Grow.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/Grow.c b/Grow.c
index 86d1020..1b45199 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1665,9 +1665,12 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
* understands '0' to mean 'max'.
*/
min_csize = 0;
+ rv = 0;
for (mdi = sra->devs; mdi; mdi = mdi->next) {
- if (sysfs_set_num(sra, mdi, "size", size) < 0)
+ if (sysfs_set_num(sra, mdi, "size", size) < 0) {
+ rv = 1;
break;
+ }
if (array.not_persistent == 0 &&
array.major_version == 0 &&
get_linux_version() < 3001000) {
@@ -1682,11 +1685,16 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
}
}
}
+ if (rv) {
+ fprintf(stderr, Name ": Cannot set size on "
+ "array members.\n");
+ goto size_change_error;
+ }
if (min_csize && size > min_csize) {
fprintf(stderr, Name ": Cannot safely make this array "
"use more than 2TB per device on this kernel.\n");
rv = 1;
- goto release;
+ goto size_change_error;
}
if (min_csize && size == 0) {
/* Don't let the kernel choose a size - it will get
@@ -1748,6 +1756,7 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
ioctl(fd, GET_ARRAY_INFO, &array);
}
+size_change_error:
if (rv != 0) {
int err = errno;
--
1.7.7.6