Commit 9f2f3830 authored by NeilBrown's avatar NeilBrown

md: Disable bad blocks and v0.90 metadata.

v0.90 metadata cannot record bad blocks, so when loading metadata
for such a device, set shift to -1.
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 2699b672
...@@ -1058,6 +1058,7 @@ static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version ...@@ -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->preferred_minor = sb->md_minor;
rdev->data_offset = 0; rdev->data_offset = 0;
rdev->sb_size = MD_SB_BYTES; rdev->sb_size = MD_SB_BYTES;
rdev->badblocks.shift = -1;
if (sb->level == LEVEL_MULTIPATH) if (sb->level == LEVEL_MULTIPATH)
rdev->desc_nr = -1; rdev->desc_nr = -1;
...@@ -3004,6 +3005,9 @@ static mdk_rdev_t *md_import_device(dev_t newdev, int super_format, int super_mi ...@@ -3004,6 +3005,9 @@ static mdk_rdev_t *md_import_device(dev_t newdev, int super_format, int super_mi
goto abort_free; goto abort_free;
} }
} }
if (super_format == -1)
/* hot-add for 0.90, or non-persistent: so no badblocks */
rdev->badblocks.shift = -1;
return rdev; return rdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment