2001-12-19 23:34:28

by Eric Sandeen

[permalink] [raw]
Subject: [PATCH] BLKSIZEGET64 broken in blkpg.c: blk_ioctl()

Unless I'm missing something here...

BLKSIZEGET64 is supposed to return device size in bytes, right?

[eric@stout linux]$ grep BLKGETSIZE64 include/linux/fs.h
#define BLKGETSIZE64 _IOR(0x12,114,sizeof(u64)) /* return device size in bytes (u64 *arg) */

But now it's just returning number of sectors as a u64 number in
blk_ioctl()

So:

--- /usr/tmp/TmpDir.26482-0/linux/drivers/block/blkpg.c_1.13 Wed Dec 19 17:03:39 2001
+++ linux/drivers/block/blkpg.c Wed Dec 19 17:02:21 2001
@@ -247,7 +247,7 @@
if (cmd == BLKGETSIZE)
return put_user((unsigned long)ullval, (unsigned long *)arg);
else
- return put_user(ullval, (u64 *)arg);
+ return put_user(ullval << 9, (u64 *)arg);
#if 0
case BLKRRPART: /* Re-read partition tables */
if (!capable(CAP_SYS_ADMIN))


-Eric

--
Eric Sandeen XFS for Linux http://oss.sgi.com/projects/xfs
[email protected] SGI, Inc.