| To: | Richard Gooch <rgooch@xxxxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: Removeable Media, partitions and devfs? |
| From: | Paul Bristow <paul@xxxxxxxxxxxxxxx> |
| Date: | Thu, 06 Dec 2001 23:12:06 +0100 |
| Cc: | "Kevin P. Fleming" <kevin@xxxxxxxxxxxxx>, Andrej.Borsenkow@xxxxxxxxxxxxxx, mfedyk@xxxxxxxxxxxxx, devfs@xxxxxxxxxxx |
| References: | <3C0C9AC5.4080504@paulbristow.net> <001801c17d15$758b6760$c8aaa8c0@kevin> <3C0D588F.9000806@paulbristow.net> <03be01c17d20$5d1b72f0$c8aaa8c0@kevin> <200112050639.fB56d0a05344@vindaloo.ras.ucalgary.ca> <00e901c17dd2$8ccffe50$c8aaa8c0@kevin> <200112060633.fB66XoZ22006@vindaloo.ras.ucalgary.ca> |
| Sender: | owner-devfs@xxxxxxxxxxx |
| User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010914 |
Richard Gooch wrote: Because I believe that most (maybe even all) of the problems are solvable with a few minor tweaks. So I'd prefer to start with a few tweaks and see if that fixes it. I like this approach. The patch also explains why I was going crazy trying to squeeze the solution into ide-floppy. I didn't initially realise the problem was more generic than just my driver. Richard, you may be pleased to know that *everyone* who emailed me assumed it was my fault in the driver, and that devfs was perfect :-) The solution, as I see it, is to force grok_partitions() to call devfs_register_disc() when size==0 and the GENHD_FL_REMOVABLE flag is set. This will cause the "disc" entry in the /dev/ide/host*/bus*/lun*/target* directory to be created, and it will tag that directory for media revalidation. At the moment no. But it could :-) So please try the appended patch again. It doesn't claim to solve the unregistering problem, but that's OK. I want to take this a step at a time. A bit more tweaking should (I hope) take care of the remaining problems. Working patch below... slightly tweaked - without media in the drive at driver load time (either kernel startup or module load), no entries are created, no access is possible to the drive The patch does fix this, by creating the disc entries regardless. Now, the problem we still have is how to automatically revalidate when a user tries to mount the a partition. This is the most common usage case for zip drives, and is not working on my system with the patch below. i.e. attempting to do this mount /dev/ide/host0/bus1/target1/lun0/part4 /mnt/zip with no disc inserted will fail, even with the /dev/ide/host0/bus1/target1/lun0/disc entry present however, having a re-validation caused, which in ide-floppy does a grok_partitions again should create the part4 entry so that the mount succeeds The following items should be future work that we will fix during 2.5. Kevin your expertise will be greatly appreciated. - when media is ejected, invalid partition entries remain in the directory
Paul Email: paul@xxxxxxxxxxxxxxx Web: http://paulbristow.net ICQ: 11965223 --- ../../../linux-2.4.16-clean/fs/partitions/check.c Fri Oct 12 02:25:10 2001 +++ check.c Thu Dec 6 21:59:14 2001 @@ -377,12 +379,19 @@ int i; int first_minor = drive << dev->minor_shift; int end_minor = first_minor + dev->max_p; + int devnum = first_minor >> dev->minor_shift; if(!dev->sizes)
blk_size[dev->major] = NULL;dev->part[first_minor].nr_sects = size; /* No such device or no minors to use for partitions */ + if ( !size && dev->flags && (dev->flags[devnum] & GENHD_FL_REMOVABLE) ) + devfs_register_disc (dev, first_minor); if (!size || minors == 1) return; |
| Previous by Date: | Re: [IDEA] Enhanced trace level system, Richard Gooch |
|---|---|
| Next by Date: | Re: Removeable Media, partitions and devfs?, Richard Gooch |
| Previous by Thread: | Re: Removeable Media, partitions and devfs?, Richard Gooch |
| Next by Thread: | Re: Removeable Media, partitions and devfs?, Richard Gooch |
| Indexes: | [Date] [Thread] [Top] [All Lists] |