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>
This commit is contained in:
@@ -245,10 +245,16 @@ struct mdp_superblock_1 {
|
||||
__u8 device_uuid[16]; /* user-space setable, ignored by kernel */
|
||||
__u8 devflags; /* per-device flags. Only one defined...*/
|
||||
#define WriteMostly1 1 /* mask for writemostly flag in above */
|
||||
__u8 pad2[64-57]; /* set to 0 when writing */
|
||||
/* Bad block log. If there are any bad blocks the feature flag is set.
|
||||
* If offset and size are non-zero, that space is reserved and available
|
||||
*/
|
||||
__u8 bblog_shift; /* shift from sectors to block size */
|
||||
__le16 bblog_size; /* number of sectors reserved for list */
|
||||
__le32 bblog_offset; /* sector offset from superblock to bblog,
|
||||
* signed - not unsigned */
|
||||
|
||||
/* array state information - 64 bytes */
|
||||
__le64 utime; /* 40 bits second, 24 btes microseconds */
|
||||
__le64 utime; /* 40 bits second, 24 bits microseconds */
|
||||
__le64 events; /* incremented when superblock updated */
|
||||
__le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */
|
||||
__le32 sb_csum; /* checksum up to devs[max_dev] */
|
||||
@@ -270,8 +276,8 @@ struct mdp_superblock_1 {
|
||||
* must be honoured
|
||||
*/
|
||||
#define MD_FEATURE_RESHAPE_ACTIVE 4
|
||||
#define MD_FEATURE_BAD_BLOCKS 8 /* badblock list is not empty */
|
||||
|
||||
#define MD_FEATURE_ALL (1|2|4)
|
||||
#define MD_FEATURE_ALL (1|2|4|8)
|
||||
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user