* Re: [PATCH] hdreg.h
@ 2002-05-09 14:06 Andries.Brouwer
2002-05-09 13:30 ` Martin Dalecki
0 siblings, 1 reply; 6+ messages in thread
From: Andries.Brouwer @ 2002-05-09 14:06 UTC (permalink / raw)
To: Andries.Brouwer, hch; +Cc: dalecki, linux-kernel, torvalds
On Thu, May 09, 2002 at 03:48:32PM +0200, Andries.Brouwer@cwi.nl wrote:
> No, fdisk, cfdisk, sfdisk do not use HDIO_GETGEO_BIG.
> And indeed, the ioctl is completely meaningless.
In many current distributions (e.g. from Red Hat, Mandrake and Caldera)
they do.
Yes, distributions are known to introduce buggy patches.
Moreover, distributions are known to copy each others bugs.
Sometimes I tell one distribution that a patch is buggy,
and they revert their patch, but some months later they
have it again, copied from some other distribution.
Even bad "segmentation fault" bugs are copied.
But for 2.5 this is not important. Distributions have time
to fix stuff before 2.6.
Andries
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] hdreg.h
2002-05-09 14:06 [PATCH] hdreg.h Andries.Brouwer
@ 2002-05-09 13:30 ` Martin Dalecki
0 siblings, 0 replies; 6+ messages in thread
From: Martin Dalecki @ 2002-05-09 13:30 UTC (permalink / raw)
To: Andries.Brouwer; +Cc: hch, linux-kernel, torvalds
Użytkownik Andries.Brouwer@cwi.nl napisał:
> On Thu, May 09, 2002 at 03:48:32PM +0200, Andries.Brouwer@cwi.nl wrote:
> > No, fdisk, cfdisk, sfdisk do not use HDIO_GETGEO_BIG.
> > And indeed, the ioctl is completely meaningless.
>
> In many current distributions (e.g. from Red Hat, Mandrake and Caldera)
> they do.
>
> Yes, distributions are known to introduce buggy patches.
>
> Moreover, distributions are known to copy each others bugs.
> Sometimes I tell one distribution that a patch is buggy,
> and they revert their patch, but some months later they
> have it again, copied from some other distribution.
> Even bad "segmentation fault" bugs are copied.
>
> But for 2.5 this is not important. Distributions have time
> to fix stuff before 2.6.
And developement kernels are known to require updated:
util-linux,
modutils
mounts
net-utils
and so on :-).
As long as long an installed system doesn't break utterly
there is no reaons IMHO why cleanups shouldn't be done.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] hdreg.h
@ 2002-05-09 13:48 Andries.Brouwer
2002-05-09 13:56 ` Christoph Hellwig
0 siblings, 1 reply; 6+ messages in thread
From: Andries.Brouwer @ 2002-05-09 13:48 UTC (permalink / raw)
To: Andries.Brouwer, dalecki; +Cc: linux-kernel, torvalds
> People complain that fdisk doesn't compile under 2.5.14
> because hdreg.h has acquired stuff that cannot be included
> from userspace. Will release util-linux 2.11r later tonight
> with a local copy.
> But now that I look at this file: it still contains
> struct hd_big_geometry and HDIO_GETGEO_BIG.
> Please remove them.
If fdisk doesn't use it. I will take your patch immediately.
One arbitrary ioctl which was introduced ad hock less. :-).
No, fdisk, cfdisk, sfdisk do not use HDIO_GETGEO_BIG.
And indeed, the ioctl is completely meaningless.
I sent the patch both to you and to Linus because it also touches
sd.c and a few other places outside the ide driver.
There is also HDIO_GETGEO_BIG_RAW, which is not entirely useless -
it gives the physical geometry that is used for actual I/O,
as opposed to the logical geometry used for the partition table.
Probably it is used only in hdparm. Modern disks use LBA and
HDIO_GETGEO_BIG_RAW is meaningless for them. Old disks that use
CHS almost always have equal physical and logical geometry.
If you throw out HDIO_GETGEO_BIG_RAW but make sure there is
a line in dmesg reporting the geometry used for CHS I/O in case
that is different from the logical I/O (bios_CHS), I wouldn't
mind at all.
Andries
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] hdreg.h
2002-05-09 13:48 Andries.Brouwer
@ 2002-05-09 13:56 ` Christoph Hellwig
0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2002-05-09 13:56 UTC (permalink / raw)
To: Andries.Brouwer; +Cc: dalecki, linux-kernel, torvalds
On Thu, May 09, 2002 at 03:48:32PM +0200, Andries.Brouwer@cwi.nl wrote:
> No, fdisk, cfdisk, sfdisk do not use HDIO_GETGEO_BIG.
> And indeed, the ioctl is completely meaningless.
In many current distributions (e.g. from Red Hat, Mandrake and Caldera)
they do.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] hdreg.h
@ 2002-05-08 23:45 Andries.Brouwer
2002-05-09 11:54 ` Martin Dalecki
0 siblings, 1 reply; 6+ messages in thread
From: Andries.Brouwer @ 2002-05-08 23:45 UTC (permalink / raw)
To: dalecki, torvalds; +Cc: linux-kernel
Linus, Martin:
People complain that fdisk doesn't compile under 2.5.14
because hdreg.h has acquired stuff that cannot be included
from userspace. Will release util-linux 2.11r later tonight
with a local copy.
But now that I look at this file: it still contains
struct hd_big_geometry and HDIO_GETGEO_BIG.
Please remove them.
Andries
diff -u --recursive --new-file ../linux-2.5.14/linux/drivers/block/cciss.c ./linux/drivers/block/cciss.c
--- ../linux-2.5.14/linux/drivers/block/cciss.c Sat May 4 00:52:47 2002
+++ ./linux/drivers/block/cciss.c Thu May 9 01:24:55 2002
@@ -436,25 +436,7 @@
return -EFAULT;
return(0);
}
- case HDIO_GETGEO_BIG:
- {
- struct hd_big_geometry driver_geo;
- if (hba[ctlr]->drv[dsk].cylinders) {
- driver_geo.heads = hba[ctlr]->drv[dsk].heads;
- driver_geo.sectors = hba[ctlr]->drv[dsk].sectors;
- driver_geo.cylinders = hba[ctlr]->drv[dsk].cylinders;
- } else {
- driver_geo.heads = 0xff;
- driver_geo.sectors = 0x3f;
- driver_geo.cylinders = hba[ctlr]->drv[dsk].nr_blocks / (0xff*0x3f);
- }
- driver_geo.start=
- hba[ctlr]->hd[minor(inode->i_rdev)].start_sect;
- if (copy_to_user((void *) arg, &driver_geo,
- sizeof( struct hd_big_geometry)))
- return -EFAULT;
- return(0);
- }
+
case BLKRRPART:
return revalidate_logvol(inode->i_rdev, 1);
case BLKGETSIZE:
diff -u --recursive --new-file ../linux-2.5.14/linux/drivers/ide/hptraid.c ./linux/drivers/ide/hptraid.c
--- ../linux-2.5.14/linux/drivers/ide/hptraid.c Mon Mar 18 21:37:15 2002
+++ ./linux/drivers/ide/hptraid.c Thu May 9 01:24:45 2002
@@ -107,22 +107,6 @@
return 0;
}
- case HDIO_GETGEO_BIG:
- {
- struct hd_big_geometry *loc = (struct hd_big_geometry *) arg;
- unsigned int bios_cyl;
- if (!loc) return -EINVAL;
- val = 255;
- if (put_user(val, (byte *) &loc->heads)) return -EFAULT;
- val = 63;
- if (put_user(val, (byte *) &loc->sectors)) return -EFAULT;
- bios_cyl = raid[minor].sectors/63/255;
- if (put_user(bios_cyl, (unsigned int *) &loc->cylinders)) return -EFAULT;
- if (put_user((unsigned)ataraid_gendisk.part[minor(inode->i_rdev)].start_sect,
- (unsigned long *) &loc->start)) return -EFAULT;
- return 0;
- }
-
case BLKROSET:
case BLKROGET:
case BLKSSZGET:
diff -u --recursive --new-file ../linux-2.5.14/linux/drivers/ide/ide-geometry.c ./linux/drivers/ide/ide-geometry.c
--- ../linux-2.5.14/linux/drivers/ide/ide-geometry.c Mon Apr 29 01:36:42 2002
+++ ./linux/drivers/ide/ide-geometry.c Tue May 7 21:59:51 2002
@@ -2,7 +2,7 @@
* linux/drivers/ide/ide-geometry.c
*
* Sun Feb 24 23:13:03 CET 2002: Patch by Andries Brouwer to remove the
- * confused CMOS probe applied. This is solving more problems then it my
+ * confused CMOS probe applied. This is solving more problems than it may
* (unexpectedly) introduce.
*/
diff -u --recursive --new-file ../linux-2.5.14/linux/drivers/ide/ide.c ./linux/drivers/ide/ide.c
--- ../linux-2.5.14/linux/drivers/ide/ide.c Thu May 9 01:08:27 2002
+++ ./linux/drivers/ide/ide.c Thu May 9 01:24:23 2002
@@ -2511,21 +2511,6 @@
return 0;
}
- case HDIO_GETGEO_BIG:
- {
- struct hd_big_geometry *loc = (struct hd_big_geometry *) arg;
-
- if (!loc || (drive->type != ATA_DISK && drive->type != ATA_FLOPPY))
- return -EINVAL;
-
- if (put_user(drive->bios_head, (byte *) &loc->heads)) return -EFAULT;
- if (put_user(drive->bios_sect, (byte *) &loc->sectors)) return -EFAULT;
- if (put_user(drive->bios_cyl, (unsigned int *) &loc->cylinders)) return -EFAULT;
- if (put_user((unsigned)drive->part[minor(inode->i_rdev)&PARTN_MASK].start_sect,
- (unsigned long *) &loc->start)) return -EFAULT;
- return 0;
- }
-
case HDIO_GETGEO_BIG_RAW:
{
struct hd_big_geometry *loc = (struct hd_big_geometry *) arg;
diff -u --recursive --new-file ../linux-2.5.14/linux/drivers/ide/pdcraid.c ./linux/drivers/ide/pdcraid.c
--- ../linux-2.5.14/linux/drivers/ide/pdcraid.c Mon Mar 18 21:37:14 2002
+++ ./linux/drivers/ide/pdcraid.c Thu May 9 01:24:35 2002
@@ -132,19 +132,6 @@
return 0;
}
- case HDIO_GETGEO_BIG:
- {
- struct hd_big_geometry *loc = (struct hd_big_geometry *) arg;
- if (!loc) return -EINVAL;
- if (put_user(raid[minor].geom.heads, (byte *) &loc->heads)) return -EFAULT;
- if (put_user(raid[minor].geom.sectors, (byte *) &loc->sectors)) return -EFAULT;
- if (put_user(raid[minor].geom.cylinders, (unsigned int *) &loc->cylinders)) return -EFAULT;
- if (put_user((unsigned)ataraid_gendisk.part[minor(inode->i_rdev)].start_sect,
- (unsigned long *) &loc->start)) return -EFAULT;
- return 0;
- }
-
-
case BLKROSET:
case BLKROGET:
case BLKSSZGET:
diff -u --recursive --new-file ../linux-2.5.14/linux/drivers/scsi/sd.c ./linux/drivers/scsi/sd.c
--- ../linux-2.5.14/linux/drivers/scsi/sd.c Thu May 9 01:08:27 2002
+++ ./linux/drivers/scsi/sd.c Thu May 9 01:23:38 2002
@@ -242,38 +242,7 @@
return -EFAULT;
return 0;
}
- case HDIO_GETGEO_BIG:
- {
- struct hd_big_geometry *loc =
- (struct hd_big_geometry *) arg;
- if(!loc)
- return -EINVAL;
- host = sdp->host;
-
- /* default to most commonly used values */
- diskinfo[0] = 0x40;
- diskinfo[1] = 0x20;
- diskinfo[2] = sdkp->capacity >> 11;
-
- /* override with calculated, extended default,
- or driver values */
- if(host->hostt->bios_param != NULL)
- host->hostt->bios_param(sdkp, dev,
- &diskinfo[0]);
- else
- scsicam_bios_param(sdkp, dev, &diskinfo[0]);
-
- if (put_user(diskinfo[0], &loc->heads) ||
- put_user(diskinfo[1], &loc->sectors) ||
- put_user(diskinfo[2],
- (unsigned int *) &loc->cylinders) ||
- put_user((unsigned)
- get_start_sect(inode->i_rdev),
- (unsigned long *)&loc->start))
- return -EFAULT;
- return 0;
- }
case BLKGETSIZE:
case BLKGETSIZE64:
case BLKROSET:
diff -u --recursive --new-file ../linux-2.5.14/linux/include/linux/hdreg.h ./linux/include/linux/hdreg.h
--- ../linux-2.5.14/linux/include/linux/hdreg.h Thu May 2 21:08:00 2002
+++ ./linux/include/linux/hdreg.h Thu May 9 01:41:50 2002
@@ -280,7 +280,7 @@
unsigned long start;
};
-/* BIG GEOMETRY */
+/* BIG GEOMETRY - dying, used only by HDIO_GETGEO_BIG_RAW */
struct hd_big_geometry {
unsigned char heads;
unsigned char sectors;
@@ -327,7 +327,7 @@
};
/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x033n/0x033n */
-#define HDIO_GETGEO_BIG 0x0330 /* */
+/* 0x330 is reserved - used to be HDIO_GETGEO_BIG */
#define HDIO_GETGEO_BIG_RAW 0x0331 /* */
#define __NEW_HD_DRIVE_ID
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] hdreg.h
2002-05-08 23:45 Andries.Brouwer
@ 2002-05-09 11:54 ` Martin Dalecki
0 siblings, 0 replies; 6+ messages in thread
From: Martin Dalecki @ 2002-05-09 11:54 UTC (permalink / raw)
To: Andries.Brouwer; +Cc: torvalds, linux-kernel
Użytkownik Andries.Brouwer@cwi.nl napisał:
> Linus, Martin:
>
> People complain that fdisk doesn't compile under 2.5.14
> because hdreg.h has acquired stuff that cannot be included
> from userspace. Will release util-linux 2.11r later tonight
> with a local copy.
> But now that I look at this file: it still contains
> struct hd_big_geometry and HDIO_GETGEO_BIG.
> Please remove them.
If fdisk doesn't use it. I will take your patch immediately.
One arbitrary ioctl which was introduced ad hock less. :-).
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-05-09 14:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-09 14:06 [PATCH] hdreg.h Andries.Brouwer
2002-05-09 13:30 ` Martin Dalecki
-- strict thread matches above, loose matches on Subject: below --
2002-05-09 13:48 Andries.Brouwer
2002-05-09 13:56 ` Christoph Hellwig
2002-05-08 23:45 Andries.Brouwer
2002-05-09 11:54 ` Martin Dalecki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox