Re: segfault in mdadm v2.6.4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 4, 2008 at 3:05 AM, Christian Pernegger <pernegger@xxxxxxxxx> wrote:
> >  Apr  4 00:36:46 frank kernel: mdadm[3954]: segfault at 0 rip 412d2c rsp
>  > 7fffcdd18fa0 error 4
>
>  The segfault after assemble is more or less "normal" with the Debian
>  version right now. Of course I haven't been able to reproduce it with
>  any consistency since I reported the bug :(
>

There is a known issue with arrays in the "read-auto" state and "mdadm
--monitor".  The attached patch addresses this.

What is more concerning is the usb-storage hangs.  Do you have logs
from when it hung?

--
Dan
mdadm: fix segfault, /proc/mdstat parsing of 'level'

From: Dan Williams <dan.j.williams@xxxxxxxxx>

If the array is in 'read-auto' mode /proc/mdstat will have a string
like:

	"active(auto-read-only)"

The parsing code does not recognize this as "active" so it does not set
->level.  This leads to a segfault in --monitor mode (Monitor.c:405).

Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
---

 mdstat.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/mdstat.c b/mdstat.c
index 335e1e5..1dcd709 100644
--- a/mdstat.c
+++ b/mdstat.c
@@ -165,7 +165,8 @@ struct mdstat_ent *mdstat_read(int hold, int start)
 		for (w=dl_next(line); w!= line ; w=dl_next(w)) {
 			int l = strlen(w);
 			char *eq;
-			if (strcmp(w, "active")==0)
+			if (strncmp(w, "active", strlen("active"))==0)
+			/* strncmp to catch the "active(auto-read-only)" case */
 				ent->active = 1;
 			else if (strcmp(w, "inactive")==0)
 				ent->active = 0;

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux