devfs
[Top] [All Lists]

Re: Removeable Media, partitions and devfs?

To: "Paul Bristow" <paul@xxxxxxxxxxxxxxx>
Subject: Re: Removeable Media, partitions and devfs?
From: "Kevin P. Fleming" <kevin@xxxxxxxxxxxxx>
Date: Tue, 4 Dec 2001 17:04:09 -0700
Cc: "devfs" <devfs@xxxxxxxxxxx>
Organization: LSG, Inc.
References: <3C0C9AC5.4080504@xxxxxxxxxxxxxxx> <001801c17d15$758b6760$c8aaa8c0@kevin> <3C0D588F.9000806@xxxxxxxxxxxxxxx>
Sender: owner-devfs@xxxxxxxxxxx
> > In the meantime, I have already forwarded patches to Richard to do
exactly
> > what you have suggested (create/remove the "disc" entries regardless of
> > whether media is present). With those entries available, it would be a
> > simple matter to issue a revalidate IOCTL from userspace when
appropriate
> > (just before you make a mount attempt).
>
>
> Automatically with devfsd?  Or would we need another user-space prog?

This would have to be done with a userspace program (I believe there is even
a command-line ioctl program out there).

>
> > Note that my patches also address
> > other issues, like when you change media and the old partX entries don't
> > disappear properly (not as big a problem, granted, but still worth
fixing).
>
>
> Yes.  I searched for days trying to find a way round this, but it just
> can't be done, short of brute force.  Is there a devfs_rm_dir() or
> devfs_rm_symlink around?
> Trust me.  I get lots of complaints about this.
>
> So this stuff exists somewhere?  Are these patches for devfs or
> ide-floppy or both?
>

They are patches to the devfs chunks in fs/partitions/check.c, and also to
ide-floppy, ide-hd and ide.c itself. They would also allow other removable
media device drivers to work the same way, with minor changes (which I was
going to implement, but that's on hold). Richard wanted time to review them
before getting them merged, and he's not had time due to rewriting most of
the devfs core. Note that there are plans afoot to radically change
partition handling in 2.5, so these patches are only a 2.4 solution, and the
same type of things will be needed in 2.5. I believe the persons working on
the new 2.5 stuff have the code I sent, but it may have been lost by now...

The patches I submitted fixed the following (working from memory, so I may
have missed something):

- always create "disc" node for removable media device, even if no media is
present
- allow device driver to explicitly request that "partX" entries be removed
(i.e. when media is being ejected and can't be revalidated)
- ensure old "partX" entries disappear when media is revalidated
- ensure that /dev nodes for ide-floppy devices disappear when ide-floppy
module is unloaded (same goes for ide-hd)

> In the meantime, I'll just put the mknod workaround on my web page in
> the FAQ section...
>
> Don't you just hate it when you can't fix it *properly*. :-(
>

It can be fixed properly, and soon. It just needs Richard to either get some
time to review the patches, or support me posting them to LKML and getting
them merged into 2.4.x soon.


<Prev in Thread] Current Thread [Next in Thread>