Blame SOURCES/0008-mdadm-super1-It-needs-to-specify-int32-for-bitmap_of.patch

7140c6
From f421731c7e1de6608f8fafb551d199ff5f1d6b97 Mon Sep 17 00:00:00 2001
7140c6
From: Xiao Ni <xni@redhat.com>
7140c6
Date: Wed, 2 Jun 2021 09:17:19 +0800
7140c6
Subject: [PATCH 08/15] mdadm/super1: It needs to specify int32 for
7140c6
 bitmap_offset
7140c6
7140c6
For super1.0 bitmap offset is -16. So it needs to use int type for bitmap offset.
7140c6
7140c6
Fixes: 1fe2e1007310 (mdadm/bitmap: locate bitmap calcuate bitmap position wrongly)
7140c6
Signed-off-by: Xiao Ni <xni@redhat.com>
7140c6
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
7140c6
---
7140c6
 super1.c | 2 +-
7140c6
 1 file changed, 1 insertion(+), 1 deletion(-)
7140c6
7140c6
diff --git a/super1.c b/super1.c
7140c6
index c05e623..a12a5bc 100644
7140c6
--- a/super1.c
7140c6
+++ b/super1.c
7140c6
@@ -2631,7 +2631,7 @@ static int locate_bitmap1(struct supertype *st, int fd, int node_num)
7140c6
 	else
7140c6
 		ret = -1;
7140c6
 
7140c6
-	offset = __le64_to_cpu(sb->super_offset) + __le32_to_cpu(sb->bitmap_offset);
7140c6
+	offset = __le64_to_cpu(sb->super_offset) + (int32_t)__le32_to_cpu(sb->bitmap_offset);
7140c6
 	if (node_num) {
7140c6
 		bms = (bitmap_super_t*)(((char*)sb)+MAX_SB_SIZE);
7140c6
 		bm_sectors_per_node = calc_bitmap_size(bms, 4096) >> 9;
7140c6
-- 
7140c6
2.7.5
7140c6