summaryrefslogtreecommitdiffstats
path: root/super1.c
diff options
context:
space:
mode:
authorXiao Ni <xni@redhat.com>2021-06-02 03:17:19 +0200
committerJes Sorensen <jsorensen@fb.com>2021-07-16 16:21:49 +0200
commitf421731c7e1de6608f8fafb551d199ff5f1d6b97 (patch)
tree779f7172ad0dbecba504afcded1209c71afede8f /super1.c
parentManage: Call validate_geometry when adding drive to external container (diff)
downloadmdadm-f421731c7e1de6608f8fafb551d199ff5f1d6b97.tar.xz
mdadm-f421731c7e1de6608f8fafb551d199ff5f1d6b97.zip
mdadm/super1: It needs to specify int32 for bitmap_offset
For super1.0 bitmap offset is -16. So it needs to use int type for bitmap offset. Fixes: 1fe2e1007310 (mdadm/bitmap: locate bitmap calcuate bitmap position wrongly) Signed-off-by: Xiao Ni <xni@redhat.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/super1.c b/super1.c
index c05e6237..a12a5bc8 100644
--- a/super1.c
+++ b/super1.c
@@ -2631,7 +2631,7 @@ static int locate_bitmap1(struct supertype *st, int fd, int node_num)
else
ret = -1;
- offset = __le64_to_cpu(sb->super_offset) + __le32_to_cpu(sb->bitmap_offset);
+ offset = __le64_to_cpu(sb->super_offset) + (int32_t)__le32_to_cpu(sb->bitmap_offset);
if (node_num) {
bms = (bitmap_super_t*)(((char*)sb)+MAX_SB_SIZE);
bm_sectors_per_node = calc_bitmap_size(bms, 4096) >> 9;