summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Kwolek <adam.kwolek@intel.com>2011-12-15 04:34:46 +0100
committerNeilBrown <neilb@suse.de>2011-12-15 04:34:46 +0100
commit97a3490c0d9eb1672a3804625d5c58bcc29a08e1 (patch)
tree9c63518dc9f564ff66ab03277c285cbc20abd6ea
parentFIX: Do not allow for multiple reshape_array() execution during reshape_conta... (diff)
downloadmdadm-97a3490c0d9eb1672a3804625d5c58bcc29a08e1.tar.xz
mdadm-97a3490c0d9eb1672a3804625d5c58bcc29a08e1.zip
FIX: Add error message in container_reshape()
Add proper error message for container reshape when device cannot be opened. fd variable operation is moved down to display information what particular device cannot be opened. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--Grow.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/Grow.c b/Grow.c
index 70b27344..28f82b10 100644
--- a/Grow.c
+++ b/Grow.c
@@ -2538,15 +2538,19 @@ int reshape_container(char *container, char *devname,
if (!content)
break;
- fd = open_dev(mdstat->devnum);
- if (fd < 0)
- break;
adev = map_dev(dev2major(mdstat->devnum),
dev2minor(mdstat->devnum),
0);
if (!adev)
adev = content->text_version;
+ fd = open_dev(mdstat->devnum);
+ if (fd < 0) {
+ printf(Name ": Device %s cannot be opened for reshape.",
+ adev);
+ break;
+ }
+
if (last_devnum == mdstat->devnum) {
/* Do not allow for multiple reshape_array() calls for
* the same array.