diff options
author | Pawel Baldysiak <pawel.baldysiak@intel.com> | 2017-09-28 14:41:11 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2017-10-02 22:11:42 +0200 |
commit | b251424242b46d62f666829c0e7a7550768fc8de (patch) | |
tree | ab6fbd34813d5f301685787eaf8912024f034ec9 /super-intel.c | |
parent | imsm: validate multiple ppls during assemble (diff) | |
download | mdadm-b251424242b46d62f666829c0e7a7550768fc8de.tar.xz mdadm-b251424242b46d62f666829c0e7a7550768fc8de.zip |
Zeroout whole ppl space during creation/force assemble
PPL area should be cleared before creation/force assemble.
If the drive was used in other RAID array, it might contains PPL from it.
There is a risk that mdadm recognizes those PPLs and
refuses to assemble the RAID due to PPL conflict with created
array.
Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'super-intel.c')
-rw-r--r-- | super-intel.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/super-intel.c b/super-intel.c index 56dec365..65cdc925 100644 --- a/super-intel.c +++ b/super-intel.c @@ -6065,7 +6065,12 @@ static int write_init_ppl_imsm(struct supertype *st, struct mdinfo *info, int fd struct ppl_header *ppl_hdr; int ret; - ret = posix_memalign(&buf, 4096, PPL_HEADER_SIZE); + /* first clear entire ppl space */ + ret = zero_disk_range(fd, info->ppl_sector, info->ppl_size); + if (ret) + return ret; + + ret = posix_memalign(&buf, MAX_SECTOR_SIZE, PPL_HEADER_SIZE); if (ret) { pr_err("Failed to allocate PPL header buffer\n"); return ret; |