Segfault with --assemble --force
PATCH 1/1 Segfault with --assemble --force
mdadm --assemble --force repeatedly segfaults when run on a raid6 array with more than two components marked as failed, so at least one needs its event count forcibly updated. sb->events is accessed with sb NULL in update_super1, called from Assemble (line 667 of Assemble.c). I think the following patch is correct:
Assemble.c +1 -1
@@ -656,7 +656,7 @@ int Assemble(struct supertype *st, charcontinue ; } tst =dup_super (st); -if (tst->ss->load_super (st,fd,NULL )) { +if (tst->ss->load_super (tst, fd,NULL )) {close (fd);fprintf (stderr, Name": RAID superblock disappeared from %s - not updating.\n" , devices[chosen_drive].devname);
Cheers,
Chris.
Quoted 11 lines · On Wednesday June 18, [email protected] wrote:
mdadm --assemble --force repeatedly segfaults when run on a raid6 array with more than two components marked as failed, so at least one needs its event count forcibly updated.
sb->eventsis accessed with sb NULL inupdate_super1, called from Assemble (line 667 ofAssemble.c). I think the following patch is correct:diff -uNrp
mdadm-2.6.7.orig/Assemble.cmdadm-2.6.7/Assemble.c
Assemble.c int Assemble(struct supertype *st, char · line 662
Quoted 8 lines
Assemble.c +1
-1@@ -656,7 +656,7 @@ int Assemble(struct supertype *st, charcontinue ; } tst =dup_super (st); -if (tst->ss->load_super (st,fd,NULL )) { +if (tst->ss->load_super (tst, fd,NULL )) {close (fd);fprintf (stderr, Name": RAID superblock disappeared from %s - not updating.\n" , devices[chosen_drive].devname);
Yes, definitely.
Thanks.
NeilBrown