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 /super1.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 'super1.c')
-rw-r--r-- | super1.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1823,6 +1823,11 @@ static int write_init_ppl1(struct supertype *st, struct mdinfo *info, int fd) struct ppl_header *ppl_hdr; int ret; + /* first clear entire ppl space */ + ret = zero_disk_range(fd, info->ppl_sector, info->ppl_size); + if (ret) + return ret; + ret = posix_memalign(&buf, 4096, PPL_HEADER_SIZE); if (ret) { pr_err("Failed to allocate PPL header buffer\n"); |