summaryrefslogtreecommitdiffstats
path: root/Grow.c
diff options
context:
space:
mode:
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Grow.c b/Grow.c
index 0916c5d..28ed8d7 100644
--- a/Grow.c
+++ b/Grow.c
@@ -948,6 +948,13 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
GET_COMPONENT|GET_DEVS|GET_OFFSET|GET_STATE|
GET_CACHE);
+ if (!sra) {
+ fprintf(stderr, Name ": %s: Cannot get array details from sysfs\n",
+ devname);
+ rv = 1;
+ break;
+ }
+
if (ndata == odata) {
/* Make 'blocks' bigger for better throughput, but
* not so big that we reject it below.
@@ -960,13 +967,6 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
fprintf(stderr, Name ": Need to backup %luK of critical "
"section..\n", blocks/2);
- if (!sra) {
- fprintf(stderr, Name ": %s: Cannot get array details from sysfs\n",
- devname);
- rv = 1;
- break;
- }
-
if (blocks >= sra->component_size/2) {
fprintf(stderr, Name ": %s: Something wrong - reshape aborted\n",
devname);