]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Detail.c
Grow: fix resize of array component size to > 32bits
[thirdparty/mdadm.git] / Detail.c
index 83395f641aa9ca9b170cb6226281e6d883ce9e55..c4fcad9620ba30aa2db22251dc9a9a5a6af1c29c 100644 (file)
--- a/Detail.c
+++ b/Detail.c
@@ -1,7 +1,7 @@
 /*
  * mdadm - manage Linux "md" devices aka RAID arrays.
  *
- * Copyright (C) 2001-2012 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2013 Neil Brown <neilb@suse.de>
  *
  *
  *    This program is free software; you can redistribute it and/or modify
@@ -109,7 +109,7 @@ int Detail(char *dev, struct context *c)
        st = super_by_fd(fd, &subarray);
        if (ioctl(fd, GET_ARRAY_INFO, &array) == 0) {
                inactive = 0;
-       } else if (errno == ENODEV) {
+       } else if (errno == ENODEV && sra) {
                array = sra->array;
                inactive = 1;
        } else {
@@ -465,8 +465,8 @@ int Detail(char *dev, struct context *c)
                               (!e || (e->percent < 0 && e->percent != RESYNC_PENDING &&
                               e->percent != RESYNC_DELAYED)) ? "" : sync_action[e->resync],
                               larray_size ? "": ", Not Started",
-                              e->percent == RESYNC_DELAYED ? " (DELAYED)": "",
-                              e->percent == RESYNC_PENDING ? " (PENDING)": "");
+                              (e && e->percent == RESYNC_DELAYED) ? " (DELAYED)": "",
+                              (e && e->percent == RESYNC_PENDING) ? " (PENDING)": "");
                } else if (inactive) {
                        printf("          State : inactive\n");
                }