linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* removable media revalidation - udev vs. devfs or static /dev
@ 2004-01-01 20:33 Andrey Borzenkov
  2004-01-03  5:58 ` Greg KH
  0 siblings, 1 reply; 66+ messages in thread
From: Andrey Borzenkov @ 2004-01-01 20:33 UTC (permalink / raw)
  To: linux-hotplug-devel, linux-kernel

udev names are created when kernel detects corr. device. Unfortunately for 
removable media kernel rescans for partitions only when I try to access 
device. Meaning - because kernel does not know partition table it did not 
send hotplug event so udev did not create device nodes. But without device 
nodes I have no way to access device in Unix :(

specifically I have now my Jaz and I have no (reasonable) way to access 
partition 4 assuming device nodes are managed by udev.

devfs solved this problem by

- always exporting at least handle to the whole disk (sda as example)
- using something simple like dd if=/dev/sda count=1 on lookup for 
non-existing partition (/dev/sda4) that would rescan partitions and create 
device nodes for them.

static /dev simply has all nodes available and does not suffer from this 
problem at all.

unfortunately there are no lookup events in case if udev ... meaning at this 
moment user must manually rescan partitions after inserting new media. I do 
not see any way to solve this problem at all given current implementation. 
The closest is to blindly create nodes for all partitions as soon as block 
device is available. 

-andrey


^ permalink raw reply	[flat|nested] 66+ messages in thread
* RE: removable media revalidation - udev vs. devfs or static /dev
@ 2004-01-08  5:19 Iqbal
  0 siblings, 0 replies; 66+ messages in thread
From: Iqbal @ 2004-01-08  5:19 UTC (permalink / raw)
  To: 'Jens Axboe'; +Cc: linux-kernel


I feel, the media revalidation issue can be solved by hacking protocol(SCSI
or USB) layer and the respective notification of the same to user space by a
signal.

-----Original Message-----
From: linux-kernel-owner@vger.kernel.org
[mailto:linux-kernel-owner@vger.kernel.org]On Behalf Of Jens Axboe
Sent: Wednesday, January 07, 2004 4:01 PM
To: Olaf Hering
Cc: Andrey Borzenkov; Andries Brouwer; Greg KH;
linux-hotplug-devel@lists.sourceforge.net; linux-kernel@vger.kernel.org
Subject: Re: removable media revalidation - udev vs. devfs or static
/dev


On Wed, Jan 07 2004, Olaf Hering wrote:
>  On Wed, Jan 07, Jens Axboe wrote:
>
> > On Wed, Jan 07 2004, Olaf Hering wrote:
> > >  On Wed, Jan 07, Jens Axboe wrote:
> > >
> > > > No need to put it in the kernel, user space fits the bil nicely. I
don't
> > > > see how this would lead to IO errors?
> > >
> > > Ok, how should it be done on my SCSI and parallel port ZIP? An ATAPI
ZIP
>         ^^^
>
> "How"? We need a sane way to deal with removeable medias.
> Do you have example code that can be put into the udev distribution?

--
Jens Axboe

-
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/


^ permalink raw reply	[flat|nested] 66+ messages in thread
* RE: removable media revalidation - udev vs. devfs or static /dev
@ 2004-01-12  9:09 Ling, Xiaofeng
  0 siblings, 0 replies; 66+ messages in thread
From: Ling, Xiaofeng @ 2004-01-12  9:09 UTC (permalink / raw)
  To: Joel Becker, Greg KH; +Cc: linux-hotplug-devel, linux-kernel

> 
> On Wed, Jan 07, 2004 at 10:57:00AM -0800, Greg KH wrote:
 to create  16 partitions for every block device, if they need them or not.
> 
> 	Um, adding all 16 partitions for a block device that 
> has 5 defined is opposite of the intention of udev, no?  
> While I'd prefer the partition code in-kernel provide hotplug 
> events for each partition, if it is instead scanned by udev, 
> udev should indeed scan the partition table.  Remember, udev 
> should be able to give the appropriate system-defined names 
> for the partition, not just 'sda1'.
> 
> Joel
  I think current kernel do provide hotplug events for each partition, the
key problem is as Linus said, the most hardware will not give a event when
media changes.  So I just use a stupid way(just like "use a big button"),
pull out first and then plug in the flashdriver when changing the media 
or inserting a media to an empty driver. Then udev can remove the old 
node for and create new node for new media. 

^ permalink raw reply	[flat|nested] 66+ messages in thread
* Re: removable media revalidation - udev vs. devfs or static /dev
@ 2004-01-12 13:02 Nicolas Mailhot
  0 siblings, 0 replies; 66+ messages in thread
From: Nicolas Mailhot @ 2004-01-12 13:02 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1188 bytes --]

Matt Mackall wrote :

> Then the dumb devices (which should be a small minority) just show up
> with a harmless excess of partitions.

You are underestimating the hardware manufacturers ingenuity. Cheap stuff
(camera card readers...) will always be dumb. In fact people have not even
been discussing there how dumb it can get. I happen to own a dual CF/SM
reader (was cheaper than the single SM reader I needed at the time). It
doesn't appear to support media change notification. In fact the reader
chip seems to simple to process both card slots at the same time. The
manufacturer solved this problem by using a mechanical plastic flap that
prevents insertion of a second card when there is already one in the
reader. There is no notification on what slot is in use to the OS. Both
windows and linux treat it as a dual reader (even though there can only be
a single card inserted at any point of time), export two drives and do
continuous polling just to find out which slot is in use.

Since the SM card is slot two, every single time I plug the reader I see
the CF part errorring out before the driver take a look at the SM one.

Cheers,

-- 
Nicolas Mailhot

[-- Attachment #2: Ceci est une partie de message numériquement signée. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2004-01-30 13:02 UTC | newest]

Thread overview: 66+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-01 20:33 removable media revalidation - udev vs. devfs or static /dev Andrey Borzenkov
2004-01-03  5:58 ` Greg KH
2004-01-03  8:51   ` Andrey Borzenkov
2004-01-03 12:37     ` Andries Brouwer
2004-01-03 12:42       ` Olaf Hering
2004-01-03 16:05         ` Andrey Borzenkov
2004-01-03 17:54           ` Jens Axboe
2004-01-07  9:43             ` Olaf Hering
2004-01-07  9:50               ` Jens Axboe
2004-01-07  9:56                 ` Olaf Hering
2004-01-07  9:59                   ` Jens Axboe
2004-01-07 10:25                     ` Olaf Hering
2004-01-07 10:31                       ` Jens Axboe
2004-01-07 10:47                         ` Andrey Borzenkov
2004-01-07 10:54                           ` Jens Axboe
2004-01-07 17:56                       ` Greg KH
2004-01-30 12:59                     ` Olaf Hering
2004-01-07 11:00                 ` Andrey Borzenkov
2004-01-07 11:05                   ` Jens Axboe
2004-01-07 11:14                     ` Andrey Borzenkov
2004-01-07 11:16                       ` Jens Axboe
2004-01-03 20:51     ` Greg KH
2004-01-07 18:38   ` Linus Torvalds
2004-01-07 18:57     ` Greg KH
2004-01-07 19:23       ` Mika Penttilä
2004-01-07 19:24         ` Greg KH
2004-01-07 19:31           ` Mika Penttilä
2004-01-08  1:38           ` Linus Torvalds
2004-01-07 19:31       ` Linus Torvalds
2004-01-07 19:50         ` Greg KH
2004-01-07 20:25           ` Richard Troth
2004-01-07 20:38             ` Valdis.Kletnieks
2004-01-07 23:34             ` Greg KH
2004-01-08  0:32           ` Martin J. Bligh
2004-01-08  0:41             ` Greg KH
2004-01-08  1:07               ` Martin J. Bligh
2004-01-08  1:15                 ` Greg KH
2004-01-08  1:50                   ` Martin J. Bligh
2004-01-08 18:34                   ` Martin Schlemmer
2004-01-08  1:48           ` Linus Torvalds
2004-01-08 14:06           ` "Andrey Borzenkov" 
2004-01-08  0:42         ` viro
2004-01-08  1:16           ` Greg KH
2004-01-09  3:36       ` Joel Becker
2004-01-09  9:49         ` Gerd Knorr
2004-01-12 17:16           ` Joel Becker
2004-01-12 23:08             ` J.A. Magallon
2004-01-07 20:52     ` Olaf Hering
2004-01-08  2:03       ` Linus Torvalds
2004-01-08  4:16         ` Gene Heskett
2004-01-08  4:23           ` Linus Torvalds
2004-01-08  7:45         ` Olaf Hering
2004-01-08  2:13     ` Andries Brouwer
2004-01-08  2:19       ` Linus Torvalds
2004-01-08  2:49         ` Andries Brouwer
2004-01-08  2:56           ` Linus Torvalds
2004-01-08  3:35             ` Andries Brouwer
2004-01-08  3:43               ` Linus Torvalds
2004-01-08  8:00                 ` Xavier Bestel
2004-01-09  0:28                 ` Robert Love
2004-01-09  0:52                   ` Linus Torvalds
2004-01-09  1:16                   ` Matt Mackall
2004-01-08 10:32             `  Éric Brunet
2004-01-08  5:19 Iqbal
2004-01-12  9:09 Ling, Xiaofeng
2004-01-12 13:02 Nicolas Mailhot

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).