From 012a8641290e566f87f1d52f54022752c39ee326 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Thu, 26 Apr 2012 17:12:57 +0200 Subject: [PATCH] Introduce sysfs_set_num_signed() and use it to set bitmap/offset mdinfo->bitmap_offset is a signed long and needs to be treated as such when passed to the kernel. This resolves the problem with adding internal bitmaps to a 1.0 array. Signed-off-by: Jes Sorensen Signed-off-by: NeilBrown --- Grow.c | 4 ++-- mdadm.h | 2 ++ sysfs.c | 8 ++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Grow.c b/Grow.c index b4b9ff2..0b0d718 100644 --- a/Grow.c +++ b/Grow.c @@ -424,8 +424,8 @@ int Grow_addbitmap(char *devname, int fd, char *file, int chunk, int delay, int if (offset_setable) { st->ss->getinfo_super(st, mdi, NULL); sysfs_init(mdi, fd, -1); - rv = sysfs_set_num(mdi, NULL, "bitmap/location", - mdi->bitmap_offset); + rv = sysfs_set_num_signed(mdi, NULL, "bitmap/location", + mdi->bitmap_offset); } else { array.state |= (1<