Re: [PATCH] 2.5.14 IDE 56

Erik Andersen (andersen@codepoet.org)
Wed, 8 May 2002 15:16:34 -0600


On Wed May 08, 2002 at 08:31:11PM +0100, Alan Cox wrote:
> > int i, type, major=0, minor=0;
> > for(i=0; i<26; i++) {
> > snprintf(device_string, sizeof(device_string), "/dev/hd%c", 'a'+i);
> > if ((fd=open(device_string, O_RDONLY | O_NONBLOCK)) < 0) {
> > continue;
> > }
>
> If it opened is it there. Suppose its an IDE floppy and no media is
> present. Maybe its hiding in ide-scsi instead. It ends up being detective
> work.

That suggests to me that IDE floppy needs to be fixed to open
even when no media is present when provided with the O_NONBLOCK
flag, which would be consistant with how CDROMs, and everything
SCSI works.

As for ide-scsi, I thought that was going to go away?

> work. The /device set up makes it explicit and clean

agreed. But I don't expect to see that showing up soon in 2.4.x,
which is what most people (like me) will be using for the next
year or two. Sure 2.5.x it might work, but it might eat your
disk too. So is groping about in /proc/ide the only way to get
reliable ide device detection for 2.4.x, or is there some other
way?

-Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/