diff options
author | Neil Brown <neilb@suse.de> | 2007-05-21 06:25:30 +0200 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2007-05-21 06:25:30 +0200 |
commit | 68754bd17c81377091e509367e8d0cf9c80369a5 (patch) | |
tree | f7eb6e6672f794a636bb1eb6bf8941e33b800bbe | |
parent | Support failing and removed of detached and faulty devices. (diff) | |
download | mdadm-68754bd17c81377091e509367e8d0cf9c80369a5.tar.xz mdadm-68754bd17c81377091e509367e8d0cf9c80369a5.zip |
Fix handling of negative bitmap offsets on 64bit hosts.
The bitmap offset is a signed 32bit number, so casting to (long)
isn't sufficient. We must cast to (int32_t).
-rw-r--r-- | ANNOUNCE-2.6.2 | 0 | ||||
-rw-r--r-- | super1.c | 4 | ||||
-rw-r--r-- | tests/02lineargrow | 0 | ||||
-rw-r--r-- | tests/07autodetect | 0 |
4 files changed, 2 insertions, 2 deletions
diff --git a/ANNOUNCE-2.6.2 b/ANNOUNCE-2.6.2 new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/ANNOUNCE-2.6.2 @@ -215,7 +215,7 @@ static void examine_super1(void *sbv, char *homehost) printf("\n"); if (sb->feature_map & __cpu_to_le32(MD_FEATURE_BITMAP_OFFSET)) { printf("Internal Bitmap : %ld sectors from superblock\n", - (long)__le32_to_cpu(sb->bitmap_offset)); + (long)(int32_t)__le32_to_cpu(sb->bitmap_offset)); } if (sb->feature_map & __le32_to_cpu(MD_FEATURE_RESHAPE_ACTIVE)) { printf(" Reshape pos'n : %llu%s\n", (unsigned long long)__le64_to_cpu(sb->reshape_position)/2, @@ -1276,7 +1276,7 @@ static void locate_bitmap1(struct supertype *st, int fd, void *sbv) sb = sbv; offset = __le64_to_cpu(sb->super_offset); - offset += (long) __le32_to_cpu(sb->bitmap_offset); + offset += (int32_t) __le32_to_cpu(sb->bitmap_offset); if (mustfree) free(sb); lseek64(fd, offset<<9, 0); diff --git a/tests/02lineargrow b/tests/02lineargrow new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/02lineargrow diff --git a/tests/07autodetect b/tests/07autodetect new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/07autodetect |