linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] blkgetsize64 ioctl
@ 2001-08-30 16:11 Michael E Brown
  2001-08-30 16:25 ` Ben LaHaise
  0 siblings, 1 reply; 17+ messages in thread
From: Michael E Brown @ 2001-08-30 16:11 UTC (permalink / raw)
  To: Ben LaHaise; +Cc: linux-kernel

Ben LaHaise wrote:
> Here's the modified patch (incompatible with e2fsprogs 1.23, but not
> conflicting with ia64: ioctls that write to disk are b0rken).

In reference to the ia64 ioctls:  I'm sorry, but disk access APIs that
don't allow access to the whole disk are what is broken. These ioctls
would not be necessary if you could actually write to the last sector of
an odd-sized disk. Have you read the comments surrounding this ioctl?

-- 
Michael Brown
Linux OS Development
Dell Computer Corp

  If each of us have one object, and we exchange them,
     then each of us still has one object.
  If each of us have one idea,   and we exchange them,
     then each of us now has two ideas.



^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: [PATCH] blkgetsize64 ioctl
@ 2001-08-31  1:15 Andries.Brouwer
  2001-08-31  1:23 ` Alan Cox
  0 siblings, 1 reply; 17+ messages in thread
From: Andries.Brouwer @ 2001-08-31  1:15 UTC (permalink / raw)
  To: alan; +Cc: bcrl, linux-kernel, michael_e_brown, tytso

    From: Ben LaHaise
    ...

An interesting conversation, this.
A is blamed for making the terrible mistake of shipping an unreserved ioctl,
very stupid, because by accident B has made the minor mistake of shipping
an unreserved ioctl.
Maybe I misread something.

    From: Michael E Brown <michael_e_brown@dell.com>

    Alan,
        Here is a patch that reserves the 108 and 109 ioctl numbers for
    get/set last sector. This patch has already been merged into the ia64
    tree, and is currently necessary in order to support the EFI GPT
    partitioning scheme on ia64. It is also in the Red Hat kernel tree. I had
    assumed that somebody at Red Hat would have forwarded it to you.

Marking the numbers not-to-be-used is certainly a good idea.

Concerning the need for this particular nonsense - we have had this
discussion earlier this year, and also without any patches
one can read the last sector.  (Using some bad kludge, but still..)

One of the patches I have at ftp.kernel.org removes the entire problem -
one needs (1) a test in ll_rw_blk.c that uses not the size in 1024-byte blocks
but in 512-byte sectors, and (2) a set-blocksize ioctl.
And this latter is needed for other reasons as well.

Maybe I should resubmit some such patch fragments?

Andries


>   Content-Disposition: attachment; filename=patch-getlastsector-20010213
>
>   ZGlmZiAtcnVQIGxpbnV4L2luY2x1ZGUvbGludXgvZnMuaCBsaW51eC1pb2N0

Yes, indeed.

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: [PATCH] blkgetsize64 ioctl
@ 2001-08-30 11:57 Andries.Brouwer
  0 siblings, 0 replies; 17+ messages in thread
From: Andries.Brouwer @ 2001-08-30 11:57 UTC (permalink / raw)
  To: bcrl, torvalds; +Cc: linux-kernel

    From: Ben LaHaise <bcrl@redhat.com>

    The patch below reserves an ioctl for getting the size in blocks of a
    device as a long long instead of long as the old ioctl did.  The patch for
    this to e2fsprogs sneaked in a bit too early.  There is a conflict with
    the ia64 get/set sector ioctls, but I that's less common than e2fsprogs.


    +#define BLKGETSIZE64 _IO(0x12,109)    /* return device size (long long *arg) */

There are more conflicts with the numbering.

But more interestingly, I don't think we need the size in blocks.
We need the size in bytes.

(In 32-bit space we need the 8 or 9 or 10 bits extra provided by
counting blocks instead of bytes, but it causes quite a few problems.
In 64-bit space we can avoid all problems and work in bytes.
(Or even in bits.))

Andries


^ permalink raw reply	[flat|nested] 17+ messages in thread
* [PATCH] blkgetsize64 ioctl
@ 2001-08-29 22:45 Ben LaHaise
  2001-08-30  0:03 ` David S. Miller
  0 siblings, 1 reply; 17+ messages in thread
From: Ben LaHaise @ 2001-08-29 22:45 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Hello,

The patch below reserves an ioctl for getting the size in blocks of a
device as a long long instead of long as the old ioctl did.  The patch for
this to e2fsprogs sneaked in a bit too early.  There is a conflict with
the ia64 get/set sector ioctls, but I that's less common than e2fsprogs.

		-ben

diff -urN /md0/kernels/2.4/v2.4.10-pre2/include/linux/fs.h work-v2.4.10-pre2/include/linux/fs.h
--- /md0/kernels/2.4/v2.4.10-pre2/include/linux/fs.h	Wed Aug 29 18:28:50 2001
+++ work-v2.4.10-pre2/include/linux/fs.h	Wed Aug 29 18:39:48 2001
@@ -166,7 +166,7 @@
 #define BLKROSET   _IO(0x12,93)	/* set device read-only (0 = read-write) */
 #define BLKROGET   _IO(0x12,94)	/* get read-only status (0 = read_write) */
 #define BLKRRPART  _IO(0x12,95)	/* re-read partition table */
-#define BLKGETSIZE _IO(0x12,96)	/* return device size */
+#define BLKGETSIZE _IO(0x12,96)	/* return device size (long *arg) */
 #define BLKFLSBUF  _IO(0x12,97)	/* flush buffer cache */
 #define BLKRASET   _IO(0x12,98)	/* Set read ahead for block device */
 #define BLKRAGET   _IO(0x12,99)	/* get current read ahead setting */
@@ -182,6 +182,7 @@
 /* This was here just to show that the number is taken -
    probably all these _IO(0x12,*) ioctls should be moved to blkpg.h. */
 #endif
+#define BLKGETSIZE64 _IO(0x12,109)	/* return device size (long long *arg) */


 #define BMAP_IOCTL 1		/* obsolete - kept for compatibility */


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2001-08-31  1:20 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-30 16:11 [PATCH] blkgetsize64 ioctl Michael E Brown
2001-08-30 16:25 ` Ben LaHaise
2001-08-30 16:44   ` Michael E Brown
2001-08-30 16:47     ` Ben LaHaise
2001-08-30 17:02       ` Michael E Brown
2001-08-30 17:12         ` Ben LaHaise
2001-08-30 17:34           ` Michael E Brown
2001-08-30 18:51           ` Theodore Tso
2001-08-30 19:03             ` Alan Cox
2001-08-30 19:10               ` Michael E Brown
2001-08-30 19:18                 ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2001-08-31  1:15 Andries.Brouwer
2001-08-31  1:23 ` Alan Cox
2001-08-30 11:57 Andries.Brouwer
2001-08-29 22:45 Ben LaHaise
2001-08-30  0:03 ` David S. Miller
2001-08-30  0:16   ` Ben LaHaise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).