diff options
author | Tomasz Majchrzak <tomasz.majchrzak@intel.com> | 2016-10-21 16:26:57 +0200 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-11-07 15:08:20 -0800 |
commit | 35b785f7691aa82c4b0b262392439cfa6f22816d (patch) | |
tree | 4b2a1c50cf44346f09ce7753f3bd769c8882808c /drivers/md/md.h | |
parent | b9bf33a8bd9d8c506f214543e341144cd978c13e (diff) | |
download | linux-35b785f7691aa82c4b0b262392439cfa6f22816d.tar.gz linux-35b785f7691aa82c4b0b262392439cfa6f22816d.tar.bz2 linux-35b785f7691aa82c4b0b262392439cfa6f22816d.zip |
md: add bad block support for external metadata
Add new rdev flag which external metadata handler can use to switch
on/off bad block support. If new bad block is encountered, notify it via
rdev 'unacknowledged_bad_blocks' sysfs file. If bad block has been
cleared, notify update to rdev 'bad_blocks' sysfs file.
When bad blocks support is being removed, just clear rdev flag. It is
not necessary to reset badblocks->shift field. If there are bad blocks
cleared or added at the same time, it is ok for those changes to be
applied to the structure. The array is in blocked state and the drive
which cannot handle bad blocks any more will be removed from the array
before it is unlocked.
Simplify state_show function by adding a separator at the end of each
string and overwrite last separator with new line.
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r-- | drivers/md/md.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index 2b2041773e79..21bd94fad96a 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -168,6 +168,9 @@ enum flag_bits { * so it is safe to remove without * another synchronize_rcu() call. */ + ExternalBbl, /* External metadata provides bad + * block management for a disk + */ }; static inline int is_badblock(struct md_rdev *rdev, sector_t s, int sectors, |