From: Jes Sorensen Date: Thu, 26 Apr 2012 15:12:57 +0000 (+0200) Subject: Introduce sysfs_set_num_signed() and use it to set bitmap/offset X-Git-Tag: mdadm-3.2.4~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=012a8641290e566f87f1d52f54022752c39ee326;p=thirdparty%2Fmdadm.git 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 --- diff --git a/Grow.c b/Grow.c index b4b9ff29..0b0d7182 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<