From 353632d927d6e46282ef4f51d4ad17940a30cdf0 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 20 Mar 2006 03:17:31 +0000 Subject: Support restarting of a reshape on --assemble Signed-off-by: Neil Brown --- sysfs.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sysfs.c') diff --git a/sysfs.c b/sysfs.c index 98947606..1774509c 100644 --- a/sysfs.c +++ b/sysfs.c @@ -98,6 +98,8 @@ struct sysarray *sysfs_read(int fd, int devnum, unsigned long options) if (load_sys(fname, buf)) goto abort; sra->component_size = strtoull(buf, NULL, 0); + /* sysfs reports "K", but we want sectors */ + sra->component_size *= 2; } if (options & GET_CHUNK) { strcpy(base, "chunk_size"); @@ -192,6 +194,8 @@ unsigned long long get_component_size(int fd) * We cannot trust GET_ARRAY_INFO ioctl as it's * size field is only 32bits. * So look in /sys/block/mdXXX/md/component_size + * + * WARNING: this returns in units of Kilobytes. */ struct stat stb; char fname[50]; -- cgit v1.2.3