diff options
author | NeilBrown <neilb@suse.de> | 2011-07-27 21:31:47 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-07-27 21:31:47 -0400 |
commit | 2699b67223aca6b1450fc2f72e40fada952afc85 (patch) | |
tree | c84d0cbb763ad03cd770a218a37f0f1ec31118af /include/linux/raid | |
parent | 34b343cff4354ab9864be83be88405fd53d928a0 (diff) |
md: load/store badblock list from v1.x metadata
Space must have been allocated when array was created.
A feature flag is set when the badblock list is non-empty, to
ensure old kernels don't load and trust the whole device.
We only update the on-disk badblocklist when it has changed.
If the badblocklist (or other metadata) is stored on a bad block, we
don't cope very well.
If metadata has no room for bad block, flag bad-blocks as disabled,
and do the same for 0.90 metadata.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'include/linux/raid')
-rw-r--r-- | include/linux/raid/md_p.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index 75cbf4f62fe8..9e65d9e20662 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
@@ -245,10 +245,16 @@ struct mdp_superblock_1 { | |||
245 | __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ | 245 | __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ |
246 | __u8 devflags; /* per-device flags. Only one defined...*/ | 246 | __u8 devflags; /* per-device flags. Only one defined...*/ |
247 | #define WriteMostly1 1 /* mask for writemostly flag in above */ | 247 | #define WriteMostly1 1 /* mask for writemostly flag in above */ |
248 | __u8 pad2[64-57]; /* set to 0 when writing */ | 248 | /* Bad block log. If there are any bad blocks the feature flag is set. |
249 | * If offset and size are non-zero, that space is reserved and available | ||
250 | */ | ||
251 | __u8 bblog_shift; /* shift from sectors to block size */ | ||
252 | __le16 bblog_size; /* number of sectors reserved for list */ | ||
253 | __le32 bblog_offset; /* sector offset from superblock to bblog, | ||
254 | * signed - not unsigned */ | ||
249 | 255 | ||
250 | /* array state information - 64 bytes */ | 256 | /* array state information - 64 bytes */ |
251 | __le64 utime; /* 40 bits second, 24 btes microseconds */ | 257 | __le64 utime; /* 40 bits second, 24 bits microseconds */ |
252 | __le64 events; /* incremented when superblock updated */ | 258 | __le64 events; /* incremented when superblock updated */ |
253 | __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */ | 259 | __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */ |
254 | __le32 sb_csum; /* checksum up to devs[max_dev] */ | 260 | __le32 sb_csum; /* checksum up to devs[max_dev] */ |
@@ -270,8 +276,8 @@ struct mdp_superblock_1 { | |||
270 | * must be honoured | 276 | * must be honoured |
271 | */ | 277 | */ |
272 | #define MD_FEATURE_RESHAPE_ACTIVE 4 | 278 | #define MD_FEATURE_RESHAPE_ACTIVE 4 |
279 | #define MD_FEATURE_BAD_BLOCKS 8 /* badblock list is not empty */ | ||
273 | 280 | ||
274 | #define MD_FEATURE_ALL (1|2|4) | 281 | #define MD_FEATURE_ALL (1|2|4|8) |
275 | 282 | ||
276 | #endif | 283 | #endif |
277 | |||