Skip to content

Commit

Permalink
md: Disable bad blocks and v0.90 metadata.
Browse files Browse the repository at this point in the history
v0.90 metadata cannot record bad blocks, so when loading metadata
for such a device, set shift to -1.

Signed-off-by: NeilBrown <neilb@suse.de>
  • Loading branch information
NeilBrown committed Jul 28, 2011
1 parent 2699b67 commit 9f2f383
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -3004,6 +3005,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;

return rdev;

Expand Down

0 comments on commit 9f2f383

Please sign in to comment.