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@xxxxxxxxx> --- Grow.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Grow.c b/Grow.c index 1828f83..97f6973 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 reentry reshape_array() * for the same device. It can happen when resahpe_array -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html