Backport patches for supporting intel vroc raid device. Commit 23774f997ea077f2cbe8a32bd8bccdd7f4560cca (devices: detect md ddf and imsm superblocks) Commit 00c9a788cc617e5e40746dee2e17287d61ee5c81 (devices: simplify md superblock checking code) Commit 7880896f0dbe730e7b47aa8040544434813eacc4 (gcc: calc size in compile time) Commit 12667e9897ad54f5723463b4c864c8259ba0be2a (fix check for md raid imsm signature on 4k devices) Commit 6a099707c433f0b3f2644c52f7773751832693a4 (clang: remove unused assignment) Otherwise, create vg on a intel vroc raid will produce below error: /* command begin */ $ pvcreate /dev/md0 $ vgcreate testvg /dev/md0 Cannot use device /dev/md0 with duplicates. /* command end */ Signed-off-by: Xiaole He <hexiaole@kylinos.cn>
26 lines
760 B
Diff
26 lines
760 B
Diff
From ecc646cea8b36d7256447311cfb7187c06600d41 Mon Sep 17 00:00:00 2001
|
|
From: Zdenek Kabelac <zkabelac@redhat.com>
|
|
Date: Fri, 28 Aug 2020 18:58:55 +0200
|
|
Subject: [PATCH 20/22] gcc: calc size in compile time
|
|
|
|
---
|
|
lib/device/dev-md.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/lib/device/dev-md.c b/lib/device/dev-md.c
|
|
index 23ce41a..8fe7fc3 100644
|
|
--- a/lib/device/dev-md.c
|
|
+++ b/lib/device/dev-md.c
|
|
@@ -50,7 +50,7 @@ static int _dev_has_md_magic(struct device *dev, uint64_t sb_offset)
|
|
}
|
|
|
|
#define IMSM_SIGNATURE "Intel Raid ISM Cfg Sig. "
|
|
-#define IMSM_SIG_LEN (strlen(IMSM_SIGNATURE))
|
|
+#define IMSM_SIG_LEN (sizeof(IMSM_SIGNATURE) - 1)
|
|
|
|
static int _dev_has_imsm_magic(struct device *dev, uint64_t devsize_sectors)
|
|
{
|
|
--
|
|
2.27.0
|
|
|