summaryrefslogtreecommitdiffstats
path: root/Build.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-05-15 04:21:33 +0000
committerNeil Brown <neilb@suse.de>2006-05-15 04:21:33 +0000
commit1bfdbe01ff300ebbf92d68c15722d2ba861aac3b (patch)
treecc0f64dabdaddf62383a377f317ad0e2b94dc9ce /Build.c
parent8686f3ed069671e5cbf8660cfd73c92b066563d0 (diff)
downloadmdadm-1bfdbe01ff300ebbf92d68c15722d2ba861aac3b.tar.gz
mdadm-1bfdbe01ff300ebbf92d68c15722d2ba861aac3b.tar.xz
mdadm-1bfdbe01ff300ebbf92d68c15722d2ba861aac3b.zip
Limit size of bitmap to 2million chunks.
When creating a file bitmap, choose a default size that results in fewer than 2^21 chunks. Without this kmalloc failure in the kernel becomes likely. Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'Build.c')
-rw-r--r--Build.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Build.c b/Build.c
index bb53a11..ff92cc1 100644
--- a/Build.c
+++ b/Build.c
@@ -204,16 +204,18 @@ int Build(char *mddev, int mdfd, int chunk, int level, int layout,
bitmap_fd = open(bitmap_file, O_RDWR);
if (bitmap_fd < 0) {
int major = BITMAP_MAJOR_HI;
+#if 0
if (bitmap_chunk == UnSet) {
fprintf(stderr, Name ": %s cannot be openned.",
bitmap_file);
return 1;
}
+#endif
if (vers < 9003) {
major = BITMAP_MAJOR_HOSTENDIAN;
#ifdef __BIG_ENDIAN
fprintf(stderr, Name ": Warning - bitmaps created on this kernel are not portable\n"
- " between different architectured. Consider upgrading the Linux kernel.\n");
+ " between different architectures. Consider upgrading the Linux kernel.\n");
#endif
}
bitmapsize = size>>9; /* FIXME wrong for RAID10 */