sync_metadata() requires st->sb to be loaded, otherwise exception is generated. This fails expansion, because spares cannot be added. Patch loads anchor before Manage.c reference to st->sb. NOTE: This fixes Raid5 expansion, Raid0 expansion is still broken. Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx> --- Manage.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/Manage.c b/Manage.c index 5808557..6233257 100644 --- a/Manage.c +++ b/Manage.c @@ -895,6 +895,7 @@ int Manage_subdevs(char *devname, int fd, int container_fd; int devnum = fd2devnum(fd); int dfd; + char container[40]; container_fd = open_dev_excl(devnum); if (container_fd < 0) { @@ -904,7 +905,9 @@ int Manage_subdevs(char *devname, int fd, tst->ss->free_super(tst); return 1; } - + fmt_devname(container, st->container_dev); + st->ss->load_container(st, + container_fd, container); dfd = dev_open(dv->devname, O_RDWR | O_EXCL|O_DIRECT); if (mdmon_running(tst->container_dev)) tst->update_tail = &tst->updates; @@ -912,12 +915,14 @@ int Manage_subdevs(char *devname, int fd, dv->devname)) { close(dfd); close(container_fd); + st->ss->free_super(st); return 1; } if (st->update_tail) flush_metadata_updates(st); else tst->ss->sync_metadata(st); + st->ss->free_super(st); sra = sysfs_read(container_fd, -1, 0); if (!sra) { -- 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