mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] BLKGETSIZE64 broken in 2.4.18-pre1, 2.5.2-pre7
@ 2002-01-04 17:40 Eric Sandeen
  0 siblings, 0 replies; only message in thread
From: Eric Sandeen @ 2002-01-04 17:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: torvalds, marcelo

BLKGETSIZE64 is supposed to return device size in bytes:

#define BLKGETSIZE64 _IOR(0x12,114,sizeof(u64)) /* return device size in
bytes (u64 *arg) */

but in drivers/block/blkpg.c, it's just returning device size/512 as a
u64 number.

This patch should apply to both kernels.

--- linux/drivers/block/blkpg.c.orig	Fri Jan  4 11:30:37 2002
+++ linux/drivers/block/blkpg.c	Fri Jan  4 11:31:15 2002
@@ -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 Sandeen      XFS for Linux     http://oss.sgi.com/projects/xfs
sandeen@sgi.com   SGI, Inc.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-04 17:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-04 17:40 [PATCH] BLKGETSIZE64 broken in 2.4.18-pre1, 2.5.2-pre7 Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®