NeilBrown <neilb@xxxxxxx> writes: > v0.90 metadata cannot record bad blocks, so when loading metadata > for such a device, set shift to -1. > > Signed-off-by: NeilBrown <neilb@xxxxxxx> > --- > > drivers/md/md.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/drivers/md/md.c b/drivers/md/md.c > index 18c3aab..340e2d4 100644 > --- a/drivers/md/md.c > +++ b/drivers/md/md.c > @@ -1058,6 +1058,7 @@ static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version > rdev->preferred_minor = sb->md_minor; > rdev->data_offset = 0; > rdev->sb_size = MD_SB_BYTES; > + rdev->badblocks.shift = -1; > > if (sb->level == LEVEL_MULTIPATH) > rdev->desc_nr = -1; > @@ -3009,6 +3010,9 @@ static mdk_rdev_t *md_import_device(dev_t newdev, int super_format, int super_mi > goto abort_free; > } > } > + if (super_format == -1) > + /* hot-add for 0.90, or non-persistent: so no badblocks */ > + rdev->badblocks.shift = -1; Maybe we need this as well: if (rdev->badblocks.shift == -1) { kfree(rdev->badblocks.page); rdev->badblocks.page = NULL; rdev->badblocks.active_page = NULL; rdev->badblocks.count = 0; } > > return rdev; > > > > -- > 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 -- 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