[Linux-cluster] GFS 2Tb limit

Ken Preslan kpreslan at redhat.com
Thu Sep 2 18:49:37 UTC 2004

On Thu, Sep 02, 2004 at 04:09:38PM +0100, Stephen Willey wrote:
> The strace output should be attached...

This is another problem with ioctls from the kernel not getting exported
to userspace correctly.  The definition we were using was correct for
Linux 2.4, but it's incorrect for 2.6.

The first ioctl() below is supposed to be BLKGETSIZE64, but the ioctl
number is wrong and the ioctl fails.  So, iddev tries BLKGETSIZE, which
can't encode the device size in a long and returns EFBIG.

open("/dev/md0", O_RDONLY|O_LARGEFILE)  = 3
fstat64(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(9, 0), ...}) = 0
ioctl(3, 0x80081272, 0xbfffe180)        = -1 EINVAL (Invalid argument)
ioctl(3, BLKGETSIZE, 0xbfffe0dc)        = -1 EFBIG (File too large)
write(2, "mkfs.gfs: ", 10mkfs.gfs: )              = 10
write(2, "can\'t determine size of /dev/md0"..., 49can't determine size of /dev/md0: File too large

Apply the below patch, recompile iddev and then mkfs, and see if that
fixes it.

diff -urN crap1/iddev/lib/size.c crap2/iddev/lib/size.c
--- crap1/iddev/lib/size.c	24 Jun 2004 08:53:40 -0000	1.1
+++ crap2/iddev/lib/size.c	2 Sep 2004 18:36:37 -0000
@@ -40,7 +40,7 @@
 #include <sys/mount.h>
 #ifndef BLKGETSIZE64
-#define BLKGETSIZE64 _IOR(0x12, 114, uint64)
+#define BLKGETSIZE64 _IOR(0x12, 114, size_t)
 static int do_device_size(int fd, uint64 *bytes)

Ken Preslan <kpreslan at redhat.com>

More information about the Linux-cluster mailing list