From owner-devfs@oss.sgi.com Sat Dec 1 00:05:08 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB1858422011 for devfs-outgoing; Sat, 1 Dec 2001 00:05:08 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB1855o21998 for ; Sat, 1 Dec 2001 00:05:05 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB174oE24136; Sat, 1 Dec 2001 00:04:50 -0700 Date: Sat, 1 Dec 2001 00:04:50 -0700 Message-Id: <200112010704.fB174oE24136@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Pavel Roskin Cc: Subject: Re: Another patch for GNUmakefile to make rpm happy In-Reply-To: References: Sender: owner-devfs@oss.sgi.com Precedence: bulk Pavel Roskin writes: > Hello, Richard! > > I appreciate that you mostly applied my patch that makes it possible to > install devfs to a clean directory and simplifies the rpm specfile. > > One thing that you somehow missed from my patch is using "mkdir -p" > so that the necessary directories are created with their parent > directories if required. No doubt it fell through the cracks because I was picking and choosing parts of your patch. That's why you should only make patches that I'm 100% happy with :-) Anyway, I've updated my tree to pass "-p" to mkdir. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Sat Dec 1 00:11:06 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB18B6H22118 for devfs-outgoing; Sat, 1 Dec 2001 00:11:06 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB18B3o22115 for ; Sat, 1 Dec 2001 00:11:03 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB17AX724349; Sat, 1 Dec 2001 00:10:33 -0700 Date: Sat, 1 Dec 2001 00:10:33 -0700 Message-Id: <200112010710.fB17AX724349@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Russell Coker Cc: devfs@oss.sgi.com Subject: Re: default config for cdrom links In-Reply-To: <20011130204515.74D7635FCA2@lyta.coker.com.au> References: <20011130204515.74D7635FCA2@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk Russell Coker writes: > The default config section for cdrom links doesn't work if uncommented. The > following extract from the Debian patch shows what needs to be changed. > > -#REGISTER ^cdrom/cdrom0$ CFUNCTION GLOBAL symlink cdroms/cdrom0 cdrom > -#UNREGISTER ^cdrom/cdrom0$ CFUNCTION GLOBAL unlink cdrom > +# create the standard /dev/cdrom symlink > +REGISTER ^cdroms/cdrom0$ CFUNCTION GLOBAL symlink cdroms/cdrom0 cdrom > +UNREGISTER ^cdroms/cdrom0$ CFUNCTION GLOBAL unlink cdrom OK, fixed. > Also does the LOOKUP entry provide any benefit? Hm. Probably not. I've removed it. Perhaps it was there as part of some other example. The comment I had suggested there were some other config lines there. I've removed that comment too. BTW: have you had a chance to play with the new permissions management? Specifically, using the RESTORE directive? It's really neat. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Sun Dec 2 23:37:47 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB37blW26903 for devfs-outgoing; Sun, 2 Dec 2001 23:37:47 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB37bgo26898 for ; Sun, 2 Dec 2001 23:37:42 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB36aGA18070; Sun, 2 Dec 2001 23:36:16 -0700 Date: Sun, 2 Dec 2001 23:36:16 -0700 Message-Id: <200112030636.fB36aGA18070@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v199.1 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 199.1 of my devfs patch is now available from: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html The devfs FAQ is also available here. Patch directly available from: ftp://ftp.??.kernel.org/pub/linux/kernel/people/rgooch/v2.4/devfs-patch-current.gz AND: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/kernel-patches/v2.4/devfs-patch-current.gz This is against 2.4.17-pre2. Highlights of this release: - Fixed bug in : was dereferencing freed pointer Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Sun Dec 2 23:49:56 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB37num27228 for devfs-outgoing; Sun, 2 Dec 2001 23:49:56 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB37nso27224 for ; Sun, 2 Dec 2001 23:49:54 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB36nkd18320; Sun, 2 Dec 2001 23:49:46 -0700 Date: Sun, 2 Dec 2001 23:49:46 -0700 Message-Id: <200112030649.fB36nkd18320@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v201 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 201 of my devfs patch is now available from: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html The devfs FAQ is also available here. Patch directly available from: ftp://ftp.??.kernel.org/pub/linux/kernel/people/rgooch/v2.5/devfs-patch-current.gz AND: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/kernel-patches/v2.5/devfs-patch-current.gz This is against 2.5.1-pre5. Highlights of this release: - Fixed bug in : was dereferencing freed pointer Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Mon Dec 3 09:18:26 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB3HIQQ04786 for devfs-outgoing; Mon, 3 Dec 2001 09:18:26 -0800 Received: from giants.mandrakesoft.com (office.mandrakesoft.com [195.68.114.34]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB3HIOo04783 for ; Mon, 3 Dec 2001 09:18:24 -0800 Received: by giants.mandrakesoft.com (Postfix, from userid 500) id A6B62C0DC; Mon, 3 Dec 2001 17:16:05 +0100 (CET) To: Gary Shea Cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem References: From: Chmouel Boudjnah Date: 03 Dec 2001 17:16:05 +0100 In-Reply-To: (Gary Shea's message of "Thu, 29 Nov 2001 15:00:43 -0700 (MST)") Message-ID: Lines: 9 User-Agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-devfs@oss.sgi.com Precedence: bulk Gary Shea writes: > Is it possible for me to convince devfs to assign the cdrom to (the devfs > equivalent of) /dev/hdc, at least until Mandrake 8.2? I don't really what do you have in your : /etc/modules /etc/modules.conf ? From owner-devfs@oss.sgi.com Mon Dec 3 11:35:25 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB3JZPi11867 for devfs-outgoing; Mon, 3 Dec 2001 11:35:25 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB3JZMo11864 for ; Mon, 3 Dec 2001 11:35:22 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB3IYvg23052; Mon, 3 Dec 2001 11:34:57 -0700 Date: Mon, 3 Dec 2001 11:34:57 -0700 Message-Id: <200112031834.fB3IYvg23052@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v199.2 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 199.2 of my devfs patch is now available from: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html The devfs FAQ is also available here. Patch directly available from: ftp://ftp.??.kernel.org/pub/linux/kernel/people/rgooch/v2.4/devfs-patch-current.gz AND: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/kernel-patches/v2.4/devfs-patch-current.gz This is against 2.4.17-pre2. Highlights of this release: - Fixed bug in : was dereferencing freed pointer - Added process group check for devfsd privileges Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Mon Dec 3 11:38:47 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB3Jcld11976 for devfs-outgoing; Mon, 3 Dec 2001 11:38:47 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB3Jcco11970 for ; Mon, 3 Dec 2001 11:38:38 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB3IcKn23184; Mon, 3 Dec 2001 11:38:20 -0700 Date: Mon, 3 Dec 2001 11:38:20 -0700 Message-Id: <200112031838.fB3IcKn23184@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v202 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 202 of my devfs patch is now available from: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html The devfs FAQ is also available here. Patch directly available from: ftp://ftp.??.kernel.org/pub/linux/kernel/people/rgooch/v2.5/devfs-patch-current.gz AND: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/kernel-patches/v2.5/devfs-patch-current.gz NOTE: kernel 2.5.1 and later require devfsd-v1.3.19 or later. This is against 2.5.1-pre5. Highlights of this release: - Fixed bug in : was dereferencing freed pointer - Added process group check for devfsd privileges Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Tue Dec 4 00:30:15 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB48UFe17124 for devfs-outgoing; Tue, 4 Dec 2001 00:30:15 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB48UAo17117 for ; Tue, 4 Dec 2001 00:30:10 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB47TpA02534; Tue, 4 Dec 2001 00:29:51 -0700 Date: Tue, 4 Dec 2001 00:29:51 -0700 Message-Id: <200112040729.fB47TpA02534@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v99.21 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 99.21 of my devfs patch is now available from: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html The devfs FAQ is also available here. Patch directly available from: ftp://ftp.??.kernel.org/pub/linux/kernel/people/rgooch/v2.2/devfs-patch-current.gz AND: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/kernel-patches/v2.2/devfs-patch-current.gz WARNING: you will need devfsd-v1.3.19 or later. NOTE: the devfs-patch-v99.x patches are maintenance patches for the old 2.2.x production kernels. Occasionally, features from a modern kernel are back-ported, but this happens rarely. This is against 2.2.20. Highlights of this release: - Ported devfs-patch-v99.20 to kernel 2.2.20 - Updated README from master HTML file - Added DEVFSD_NOTIFY_DELETE event - Removed unused DEVFS_FL_SHOW_UNREG flag - Send DEVFSD_NOTIFY_REGISTERED events in - Do not send CREATE, CHANGE, ASYNC_OPEN or DELETE events from devfsd or children - Switched to process group check for devfsd privileges - Fixed drivers/scsi/osst.c to account for change - Remove /dev/ide when IDE module unloaded - Made drivers/block/cpqarray.c devfs-friendly - Made drivers/block/cciss.c devfs-friendly Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Tue Dec 4 02:42:20 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB4AgKA21264 for devfs-outgoing; Tue, 4 Dec 2001 02:42:20 -0800 Received: from calvin.paulbristow.lan (ppp468-cwdsl.fr.cw.net [62.210.101.213] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB4AgCo21257 for ; Tue, 4 Dec 2001 02:42:13 -0800 Received: from paulbristow.net (zoltar [192.168.30.10]) by calvin.paulbristow.lan (8.9.3/8.8.7) with ESMTP id KAA07373 for ; Tue, 4 Dec 2001 10:39:13 +0100 Message-ID: <3C0C9AC5.4080504@paulbristow.net> Date: Tue, 04 Dec 2001 10:43:33 +0100 From: Paul Bristow User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010914 X-Accept-Language: en-us MIME-Version: 1.0 To: devfs@oss.sgi.com Subject: Removeable Media, partitions and devfs? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi everyone, I have spent three entire days trying to work out what can be done to the ide-floppy driver to fix the problems people are having with devfs. However, as far as I can tell, the driver is working correctly, but the behaviour is not user-friendly. The problem is simple. If there is no disk in the drive when the driver is loaded, then no device nodes are created. The device nodes are actually created by the grok_partitions call in fs/partitions/check.c. The grok_partitions will create the disc node and any partitions IF there is a disk present. Most people with Zip drives have the entry /dev/hdx4 -> /mnt/zip in their fstab. The effect is that, if the driver was loaded with no disk in the drive, no nodes are created, and hence the mount attempt fails with a "device not found" error. If the driver is compiled as a module, you can rmmod and insmod with a disk inserted. If the driver is compiled in, you have to reboot. I could screw up the grok_partitions to always create a disc entry, but that won't actually help, unless I also create a part4 entry. This way madness lies. Is there a way within devfs to get a mount attempt to cause a revalidate_disc to be called when the relevant device directory is scanned? In the ide-floppy driver this would be the /host/bus/target/lun folder... This way fixes it with no changes to grok_partitions or the drivers, and should work for all removeable media. -- Paul ide-floppy maintainer for devfs Email: paul@paulbristow.net Web: http://paulbristow.net ICQ: 11965223 From owner-devfs@oss.sgi.com Tue Dec 4 07:09:17 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB4F9H402383 for devfs-outgoing; Tue, 4 Dec 2001 07:09:17 -0800 Received: from hotmail.com (oe55.law7.hotmail.com [216.33.236.194]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB4F99o02377 for ; Tue, 4 Dec 2001 07:09:09 -0800 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 4 Dec 2001 06:09:03 -0800 X-Originating-IP: [24.38.105.5] From: "James McMechan" To: "Paul Bristow" , References: <3C0C9AC5.4080504@paulbristow.net> Subject: Re: Removeable Media, partitions and devfs? Date: Tue, 4 Dec 2001 06:07:59 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: X-OriginalArrivalTime: 04 Dec 2001 14:09:03.0305 (UTC) FILETIME=[3A66F390:01C17CCD] Sender: owner-devfs@oss.sgi.com Precedence: bulk Yes, this is similar to a problem I had with User-Mode-Linux it appears that the partitoning must be done at "init" time in order to have a bootable partiton map (even if devfs is not mounted) and the device nodes created But this requires reading the device before it is "open"ed You should be returning 1 from the check_media_change bdop when the new disk is inserted this should cause the revalidate where you can update the partitions and devfs will create the device nodes. Also at open time check_disk_change should be called instead if the map may have changed without notification. This still leaves the problem of having a device node to open so that the map is revalidated and the device nodes created :( see http://www.xml.com/ldd/chapter/book/ch12.html#t7 Removeable devices and http://www.xml.com/ldd/chapter/book/ch12.html#t8 Partitionable devices Linux Device Drivers 2nd Ed is a very nice book (in print & electrons) http://www.oreilly.com/catalog/linuxdrive2/ I still have not figured out how to handle this properly. Suggestions welcome. One of my problems was that at init time kmalloc paniced and it required the boot memory allocator but only at init time, later it needed kmalloc. And reading from a un"open"ed devices caused several other assumptions to break in the User-Mode-Linux user-block-device :( ----- Original Message ----- From: "Paul Bristow" To: Sent: Tuesday, December 04, 2001 1:43 AM Subject: Removeable Media, partitions and devfs? > Hi everyone, > > I have spent three entire days trying to work out what can be done to > the ide-floppy driver to fix the problems people are having with devfs. > However, as far as I can tell, the driver is working correctly, but > the behaviour is not user-friendly. > > The problem is simple. If there is no disk in the drive when the driver > is loaded, then no device nodes are created. The device nodes are > actually created by the grok_partitions call in fs/partitions/check.c. > > The grok_partitions will create the disc node and any partitions IF > there is a disk present. > > Most people with Zip drives have the entry /dev/hdx4 -> /mnt/zip in > their fstab. The effect is that, if the driver was loaded with no disk > in the drive, no nodes are created, and hence the mount attempt fails > with a "device not found" error. If the driver is compiled as a module, > you can rmmod and insmod with a disk inserted. If the driver is > compiled in, you have to reboot. > > I could screw up the grok_partitions to always create a disc entry, but > that won't actually help, unless I also create a part4 entry. This way > madness lies. > > Is there a way within devfs to get a mount attempt to cause a > revalidate_disc to be called when the relevant device directory is > scanned? In the ide-floppy driver this would be the > /host/bus/target/lun folder... > > This way fixes it with no changes to grok_partitions or the drivers, and > should work for all removeable media. > > -- > > Paul > > ide-floppy maintainer for devfs > > Email: paul@paulbristow.net > Web: http://paulbristow.net > ICQ: 11965223 > > > From owner-devfs@oss.sgi.com Tue Dec 4 11:43:15 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB4JhFP04642 for devfs-outgoing; Tue, 4 Dec 2001 11:43:15 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB4Jh8o04639 for ; Tue, 4 Dec 2001 11:43:08 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB4Ih8l09767; Tue, 4 Dec 2001 11:43:08 -0700 Date: Tue, 4 Dec 2001 11:43:08 -0700 Message-Id: <200112041843.fB4Ih8l09767@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v199.3 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 199.3 of my devfs patch is now available from: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html The devfs FAQ is also available here. Patch directly available from: ftp://ftp.??.kernel.org/pub/linux/kernel/people/rgooch/v2.4/devfs-patch-current.gz AND: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/kernel-patches/v2.4/devfs-patch-current.gz This is against 2.4.17-pre2. Highlights of this release: - Use SLAB_ATOMIC in from Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Tue Dec 4 11:45:23 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB4JjN004698 for devfs-outgoing; Tue, 4 Dec 2001 11:45:23 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB4JjIo04695 for ; Tue, 4 Dec 2001 11:45:18 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB4IjFl09926; Tue, 4 Dec 2001 11:45:15 -0700 Date: Tue, 4 Dec 2001 11:45:15 -0700 Message-Id: <200112041845.fB4IjFl09926@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v203 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 203 of my devfs patch is now available from: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html The devfs FAQ is also available here. Patch directly available from: ftp://ftp.??.kernel.org/pub/linux/kernel/people/rgooch/v2.5/devfs-patch-current.gz AND: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/kernel-patches/v2.5/devfs-patch-current.gz NOTE: kernel 2.5.1 and later require devfsd-v1.3.19 or later. This is against 2.5.1-pre5. Highlights of this release: - Use SLAB_ATOMIC in from Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Tue Dec 4 15:41:38 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB4NfcX28517 for devfs-outgoing; Tue, 4 Dec 2001 15:41:38 -0800 Received: from mail.labsysgrp.com (PHNX1-UBR2-4-hfc-0251-d1dae065.rdc1.az.coxatwork.com [209.218.224.101] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB4NfRo28511 for ; Tue, 4 Dec 2001 15:41:28 -0800 Received: from amavis by mail.labsysgrp.com with scanned-ok (Exim 3.33 #1) id 16BOFc-0005S5-00 for devfs@oss.sgi.com; Tue, 04 Dec 2001 15:41:20 -0700 Received: from [192.168.170.1] (helo=jeeves.kpf.internal) by mail.labsysgrp.com with esmtp (Exim 3.33 #1) id 16BOFZ-0005Rj-00; Tue, 04 Dec 2001 15:41:18 -0700 Received: from [192.168.170.200] (helo=kevin) by jeeves.kpf.internal with smtp (Exim 3.30 #1) id 16BOEm-0001aJ-00; Tue, 04 Dec 2001 15:40:28 -0700 Message-ID: <001801c17d15$758b6760$c8aaa8c0@kevin> From: "Kevin P. Fleming" To: "Paul Bristow" , References: <3C0C9AC5.4080504@paulbristow.net> Subject: Re: Removeable Media, partitions and devfs? Date: Tue, 4 Dec 2001 15:46:06 -0700 Organization: LSG, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-devfs@oss.sgi.com Precedence: bulk Side note: the propery way to fix this (IMHO) is to implement Media Status Notification in the ide-floppy driver, so that the driver will be aware when the user inserts and removes media from the device. This, however, will not be practical (although possibly) until Andre's new IDE drivers get merged into the kernel, since they provide clean and simple taskfile support (and Media Status Notification requires using ATA, not ATAPI, commands, which are hard to handle with the current ide driver subsystem). 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). 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). ----- Original Message ----- From: "Paul Bristow" To: Sent: Tuesday, December 04, 2001 2:43 AM Subject: Removeable Media, partitions and devfs? > Hi everyone, > > I have spent three entire days trying to work out what can be done to > the ide-floppy driver to fix the problems people are having with devfs. > However, as far as I can tell, the driver is working correctly, but > the behaviour is not user-friendly. > > The problem is simple. If there is no disk in the drive when the driver > is loaded, then no device nodes are created. The device nodes are > actually created by the grok_partitions call in fs/partitions/check.c. > > The grok_partitions will create the disc node and any partitions IF > there is a disk present. > > Most people with Zip drives have the entry /dev/hdx4 -> /mnt/zip in > their fstab. The effect is that, if the driver was loaded with no disk > in the drive, no nodes are created, and hence the mount attempt fails > with a "device not found" error. If the driver is compiled as a module, > you can rmmod and insmod with a disk inserted. If the driver is > compiled in, you have to reboot. > > I could screw up the grok_partitions to always create a disc entry, but > that won't actually help, unless I also create a part4 entry. This way > madness lies. > > Is there a way within devfs to get a mount attempt to cause a > revalidate_disc to be called when the relevant device directory is > scanned? In the ide-floppy driver this would be the > /host/bus/target/lun folder... > > This way fixes it with no changes to grok_partitions or the drivers, and > should work for all removeable media. > > -- > > Paul > > ide-floppy maintainer for devfs > > Email: paul@paulbristow.net > Web: http://paulbristow.net > ICQ: 11965223 > > > > > From owner-devfs@oss.sgi.com Tue Dec 4 16:12:14 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB50CEu29728 for devfs-outgoing; Tue, 4 Dec 2001 16:12:14 -0800 Received: from calvin.paulbristow.lan (ppp134-cwdsl.fr.cw.net [62.210.100.134] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB50C4o29725 for ; Tue, 4 Dec 2001 16:12:05 -0800 Received: from paulbristow.net (zoltar [192.168.30.10]) by calvin.paulbristow.lan (8.9.3/8.8.7) with ESMTP id BAA10734; Wed, 5 Dec 2001 01:08:31 +0100 Message-ID: <3C0D588F.9000806@paulbristow.net> Date: Wed, 05 Dec 2001 00:13:19 +0100 From: Paul Bristow User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010914 X-Accept-Language: en-us MIME-Version: 1.0 To: "Kevin P. Fleming" CC: devfs Subject: Re: Removeable Media, partitions and devfs? References: <3C0C9AC5.4080504@paulbristow.net> <001801c17d15$758b6760$c8aaa8c0@kevin> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi again Kevin, Kevin P. Fleming wrote: > Side note: the propery way to fix this (IMHO) is to implement Media Status > Notification in the ide-floppy driver, so that the driver will be aware when > the user inserts and removes media from the device. This, however, will not > be practical (although possibly) until Andre's new IDE drivers get merged > into the kernel, since they provide clean and simple taskfile support (and > Media Status Notification requires using ATA, not ATAPI, commands, which are > hard to handle with the current ide driver subsystem). 2.5 stuff... It will come. We just need to get the drive to tell us if a disk is there. Not that that helps with the thing the users are complaining about. > 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? > 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? 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*. :-( Cheers, -- Paul Email: paul@paulbristow.net Web: http://paulbristow.net ICQ: 11965223 From owner-devfs@oss.sgi.com Tue Dec 4 16:59:38 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB50xco31565 for devfs-outgoing; Tue, 4 Dec 2001 16:59:38 -0800 Received: from mail.labsysgrp.com (PHNX1-UBR2-4-hfc-0251-d1dae065.rdc1.az.coxatwork.com [209.218.224.101] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB50xTo31560 for ; Tue, 4 Dec 2001 16:59:31 -0800 Received: from amavis by mail.labsysgrp.com with scanned-ok (Exim 3.33 #1) id 16BPT9-0005tB-00 for devfs@oss.sgi.com; Tue, 04 Dec 2001 16:59:23 -0700 Received: from [192.168.170.1] (helo=jeeves.kpf.internal) by mail.labsysgrp.com with esmtp (Exim 3.33 #1) id 16BPT6-0005sI-00; Tue, 04 Dec 2001 16:59:20 -0700 Received: from [192.168.170.200] (helo=kevin) by jeeves.kpf.internal with smtp (Exim 3.30 #1) id 16BPSJ-00022W-00; Tue, 04 Dec 2001 16:58:31 -0700 Message-ID: <03be01c17d20$5d1b72f0$c8aaa8c0@kevin> From: "Kevin P. Fleming" To: "Paul Bristow" Cc: "devfs" References: <3C0C9AC5.4080504@paulbristow.net> <001801c17d15$758b6760$c8aaa8c0@kevin> <3C0D588F.9000806@paulbristow.net> Subject: Re: Removeable Media, partitions and devfs? Date: Tue, 4 Dec 2001 17:04:09 -0700 Organization: LSG, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-devfs@oss.sgi.com Precedence: bulk > > 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. From owner-devfs@oss.sgi.com Tue Dec 4 23:39:17 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB57dHd13879 for devfs-outgoing; Tue, 4 Dec 2001 23:39:17 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB57d9o13875 for ; Tue, 4 Dec 2001 23:39:09 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB56d0a05344; Tue, 4 Dec 2001 23:39:00 -0700 Date: Tue, 4 Dec 2001 23:39:00 -0700 Message-Id: <200112050639.fB56d0a05344@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: "Kevin P. Fleming" Cc: "Paul Bristow" , Andrej.Borsenkow@mow.siemens.ru, mfedyk@matchmail.com, devfs@oss.sgi.com Subject: Re: Removeable Media, partitions and devfs? In-Reply-To: <03be01c17d20$5d1b72f0$c8aaa8c0@kevin> References: <3C0C9AC5.4080504@paulbristow.net> <001801c17d15$758b6760$c8aaa8c0@kevin> <3C0D588F.9000806@paulbristow.net> <03be01c17d20$5d1b72f0$c8aaa8c0@kevin> Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. While I'm not finished with devfs core hacking, I thought I'd set aside some time on this issue, as people seem to be tearing their hair out :-) So here are some thoughts. What I don't want to see: - ide-floppy hacked up to explicitely create devfs entries. As far as I'm concerned, that driver is correct - creation of compatibilty symlinks in kernel-space - structural changes to devfs code in fs/partitions/check.c - a patch that's more than 20 lines long. 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. If you read that directory, or attempt a lookup of some leaf node, the media will be revalidated. If there's new media in the drive, the normal partition handling code should be invoked, and thus the appropriate leaf nodes will be created. Take the media out, and the next readdir or lookup will remove partition entries (assuming the ide-floppy driver doesn't set the size back to 0). Magic. Just the way god^H^H^HI intended. So, I've appended a patch which does this. Please try it out and let me know what you think. And hey! The patch is a mere 11 lines long. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca --- check.c~ Thu Oct 11 18:25:10 2001 +++ check.c Tue Dec 4 23:36:06 2001 @@ -383,6 +383,8 @@ dev->part[first_minor].nr_sects = size; /* No such device or no minors to use for partitions */ + if (!size && (dev->flags[drive] & GENHD_FL_REMOVABLE)) + devfs_register_disc (dev, minor); if (!size || minors == 1) return; From owner-devfs@oss.sgi.com Wed Dec 5 12:11:53 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB5KBrG23141 for devfs-outgoing; Wed, 5 Dec 2001 12:11:53 -0800 Received: from ns.local.net ([12.254.190.70]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB5KBmo23131 for ; Wed, 5 Dec 2001 12:11:48 -0800 Received: by ns.local.net (Postfix, from userid 501) id 564A536C0E; Wed, 5 Dec 2001 12:11:26 -0700 (MST) Received: from localhost (localhost [127.0.0.1]) by ns.local.net (Postfix) with ESMTP id 528D25DC5E; Wed, 5 Dec 2001 12:11:26 -0700 (MST) Date: Wed, 5 Dec 2001 12:11:26 -0700 (MST) From: Gary Shea X-X-Sender: shea@ns.local.net To: Chmouel Boudjnah Cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-devfs@oss.sgi.com Precedence: bulk Chmouel Boudjnah (chmouel@mandrakesoft.com) wrote: > Gary Shea writes: > > > Is it possible for me to convince devfs to assign the cdrom to (the devfs > > equivalent of) /dev/hdc, at least until Mandrake 8.2? I don't really > > what do you have in your : > > /etc/modules > /etc/modules.conf ? Sorry about the delay, I'm a cable modem victim ;) /etc/modules: scsi_hostadapter /etc/modules.conf pre-install pcmcia_core CARDMGR_OPTS=-f /etc/rc.d/init.d/pcmcia start alias usb-interface usb-uhci # probeall scsi_hostadapter ide-scsi # From the old system alias sound msnd_pinnacle post-install msnd_pinnacle /etc/sound/pinnaclecfg 0x270 reset; /etc/sound/pinnaclecfg 0x270 dsp 0x290 5 0xd0000 alias midi mpu401 options mpu401 io=0x330 irq=5 options msnd_pinnacle io=0x290 irq=5 cfg=0x270 mem=0xd0000 alias eth0 natsemi The initial boot was with a (brand new) TDK TDRW241040 burner as the only cdrom. The lilo.conf file had 'hdc=scsi-ide' set for all entries (I removed it as soon as I realized that the cdrom was being forced into the scsi-ide driver and for some obscure reason not working); the 'probeall scsi_hostadapter ide-scsi' was present in /etc/modules.conf (I commented it out); and I have (so far) ignored the 'scsi_hostadapter' line in /etc/modules (the scsi_mod and sr_mod modules show up in lsmod). Hope that's useful... Gary From owner-devfs@oss.sgi.com Wed Dec 5 14:14:37 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB5MEbS00846 for devfs-outgoing; Wed, 5 Dec 2001 14:14:37 -0800 Received: from mail.labsysgrp.com (PHNX1-UBR2-4-hfc-0251-d1dae065.rdc1.az.coxatwork.com [209.218.224.101] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB5MEOo00842 for ; Wed, 5 Dec 2001 14:14:25 -0800 Received: from amavis by mail.labsysgrp.com with scanned-ok (Exim 3.33 #1) id 16BjMv-0006hH-00 for devfs@oss.sgi.com; Wed, 05 Dec 2001 14:14:17 -0700 Received: from jeeves.kpf.internal ([192.168.170.1]) by mail.labsysgrp.com with esmtp (Exim 3.33 #1) id 16BjMl-0006gN-00; Wed, 05 Dec 2001 14:14:08 -0700 Received: from [192.168.170.200] (helo=kevin) by jeeves.kpf.internal with smtp (Exim 3.30 #1) id 16BjMa-0003Tq-00; Wed, 05 Dec 2001 14:13:56 -0700 Message-ID: <00e901c17dd2$8ccffe50$c8aaa8c0@kevin> From: "Kevin P. Fleming" To: "Richard Gooch" Cc: "Paul Bristow" , , , References: <3C0C9AC5.4080504@paulbristow.net><001801c17d15$758b6760$c8aaa8c0@kevin><3C0D588F.9000806@paulbristow.net><03be01c17d20$5d1b72f0$c8aaa8c0@kevin> <200112050639.fB56d0a05344@vindaloo.ras.ucalgary.ca> Subject: Re: Removeable Media, partitions and devfs? Date: Wed, 5 Dec 2001 14:19:40 -0700 Organization: LSG, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-devfs@oss.sgi.com Precedence: bulk (Apologies in advance for the length of this message) ----- Original Message ----- From: "Richard Gooch" > Hi, all. While I'm not finished with devfs core hacking, I thought > I'd set aside some time on this issue, as people seem to be tearing > their hair out :-) So here are some thoughts. Great! Glad to hear it. > > What I don't want to see: I'll respond to these points in the context of the patches I've already submitted. > - ide-floppy hacked up to explicitely create devfs entries. As far as > I'm concerned, that driver is correct I did not make any changes of this type; I only added two devfs-related calls in ide-floppy, to unregister any existing partition entries if the media is ejected or reformatted. IMHO this is the proper way to go, rather than have the entries stay around until the media is somehow revalidated. I also added explicit removal of any existing partition entries in ide.c itself, whenever it is about to call the 'revalidate' operation for one of its subdrivers. Without this change, old partition entries will never be removed (think of inserting a disk with only part2 on it, where the previous disk had part3 and part4; without explicit removal, the directory will show part2, part3 and part4). This same change was made in other block device drivers, but not all of them. > > - creation of compatibilty symlinks in kernel-space > Agreed, this would be bad. > - structural changes to devfs code in fs/partitions/check.c > This seems to be a non-sensical restriction; why should the code in this file be above modification? If the proper way to solve the problem(s) requires finer granularity of registering/deregistering disc and partition entries, the only way to do this is modify the existing code or create entirely new functions (with duplicate functionality). > - a patch that's more than 20 lines long. > I can't see where this is even a relevant point. Are you saying there is no valid solution that requires more than 20 lines of patch code? How can you know that? > 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. > > If you read that directory, or attempt a lookup of some leaf node, the > media will be revalidated. If there's new media in the drive, the > normal partition handling code should be invoked, and thus the > appropriate leaf nodes will be created. Take the media out, and the > next readdir or lookup will remove partition entries (assuming the > ide-floppy driver doesn't set the size back to 0). Magic. Just the way > god^H^H^HI intended. Nope, grok_partitions does not cause existing entries to be removed, unless the "size" is left at its original value, in which case your system log will be filled with "unable to read partition table" errors and errors from the ide layer trying to read non-existent media. > > So, I've appended a patch which does this. Please try it out and let > me know what you think. And hey! The patch is a mere 11 lines long. > > Regards, > > Richard.... > Permanent: rgooch@atnf.csiro.au > Current: rgooch@ras.ucalgary.ca > > --- check.c~ Thu Oct 11 18:25:10 2001 > +++ check.c Tue Dec 4 23:36:06 2001 > @@ -383,6 +383,8 @@ > > dev->part[first_minor].nr_sects = size; > /* No such device or no minors to use for partitions */ > + if (!size && (dev->flags[drive] & GENHD_FL_REMOVABLE)) > + devfs_register_disc (dev, minor); > if (!size || minors == 1) > return; > > As noted in my other email (which I accidentally sent only to Richard), this does not compile, and with minor changes it compiles but Oopses my machine. It also addresses only a small part of the problem. I really can't believe that it is so hard to get such a simple set of patches incorporated that fix a multitude of problems. Once again, I will list the existing problems as I see them; anyone else, feel free to add items or tell me I'm hallucinating :-) - 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 - when media is ejected, invalid partition entries remain in the directory - when media is repartitioned, invalid partition entries remain in the directory - when media is reformatted, invalid partition entries remain in the directory - when ide-floppy (or ide-hd) modules are unloaded, the disc/partition entries (and the directory) are not removed From owner-devfs@oss.sgi.com Wed Dec 5 22:52:07 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB66q7d17682 for devfs-outgoing; Wed, 5 Dec 2001 22:52:07 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB66pxo17679 for ; Wed, 5 Dec 2001 22:51:59 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB65pwZ21371; Wed, 5 Dec 2001 22:51:58 -0700 Date: Wed, 5 Dec 2001 22:51:58 -0700 Message-Id: <200112060551.fB65pwZ21371@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Gary Shea Cc: Chmouel Boudjnah , devfs@oss.sgi.com Subject: Re: devfs/cdrom problem In-Reply-To: References: Sender: owner-devfs@oss.sgi.com Precedence: bulk Gary Shea writes: > Chmouel Boudjnah (chmouel@mandrakesoft.com) wrote: > > Gary Shea writes: > > > > > Is it possible for me to convince devfs to assign the cdrom to (the devfs > > > equivalent of) /dev/hdc, at least until Mandrake 8.2? I don't really > > > > what do you have in your : > > > > /etc/modules > > /etc/modules.conf ? > > Sorry about the delay, I'm a cable modem victim ;) > > /etc/modules: > scsi_hostadapter > > /etc/modules.conf > pre-install pcmcia_core CARDMGR_OPTS=-f /etc/rc.d/init.d/pcmcia start > alias usb-interface usb-uhci > # probeall scsi_hostadapter ide-scsi > # From the old system > alias sound msnd_pinnacle > post-install msnd_pinnacle /etc/sound/pinnaclecfg 0x270 reset; > /etc/sound/pinnaclecfg 0x270 dsp 0x290 5 0xd0000 > alias midi mpu401 > options mpu401 io=0x330 irq=5 > options msnd_pinnacle io=0x290 irq=5 cfg=0x270 mem=0xd0000 > alias eth0 natsemi > > The initial boot was with a (brand new) TDK TDRW241040 burner as the > only cdrom. The lilo.conf file had 'hdc=scsi-ide' set for all > entries (I removed it as soon as I realized that the cdrom was being > forced into the scsi-ide driver and for some obscure reason not > working); the 'probeall scsi_hostadapter ide-scsi' was present in > /etc/modules.conf (I commented it out); and I have (so far) ignored > the 'scsi_hostadapter' line in /etc/modules (the scsi_mod and sr_mod > modules show up in lsmod). > > Hope that's useful... I have no idea what the problem was anymore. It was too long ago. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Wed Dec 5 23:34:05 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB67Y5r18483 for devfs-outgoing; Wed, 5 Dec 2001 23:34:05 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB67Xoo18478 for ; Wed, 5 Dec 2001 23:33:50 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB66XoZ22006; Wed, 5 Dec 2001 23:33:50 -0700 Date: Wed, 5 Dec 2001 23:33:50 -0700 Message-Id: <200112060633.fB66XoZ22006@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: "Kevin P. Fleming" Cc: "Paul Bristow" , , , Subject: Re: Removeable Media, partitions and devfs? In-Reply-To: <00e901c17dd2$8ccffe50$c8aaa8c0@kevin> 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> Sender: owner-devfs@oss.sgi.com Precedence: bulk Kevin P. Fleming writes: > > What I don't want to see: > > I'll respond to these points in the context of the patches I've already > submitted. > > > - ide-floppy hacked up to explicitely create devfs entries. As far as > > I'm concerned, that driver is correct > > I did not make any changes of this type; I only added two > devfs-related calls in ide-floppy, to unregister any existing > partition entries if the media is ejected or reformatted. IMHO this > is the proper way to go, rather than have the entries stay around > until the media is somehow revalidated. I also added explicit > removal of any existing partition entries in ide.c itself, whenever > it is about to call the 'revalidate' operation for one of its > subdrivers. Without this change, old partition entries will never be > removed (think of inserting a disk with only part2 on it, where the > previous disk had part3 and part4; without explicit removal, the > directory will show part2, part3 and part4). This same change was > made in other block device drivers, but not all of them. IIRC, Paul made a patch that did this. I was just stating my position after reading through the various threads. However, as I recall, at least one version of your patch completely unregistered a disc and then re-registered it. That's definately the wrong approach, as I've said before, because it opens up a race. The same disc could end up with a different number in /dev/discs. Apologies if your patch doesn't do this now: I haven't looked closely. That's partly because it's long, and I believe a short patch should be fine. > > - structural changes to devfs code in fs/partitions/check.c > > This seems to be a non-sensical restriction; why should the code in > this file be above modification? If the proper way to solve the > problem(s) requires finer granularity of registering/deregistering > disc and partition entries, the only way to do this is modify the > existing code or create entirely new functions (with duplicate > functionality). 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. > > - a patch that's more than 20 lines long. > > I can't see where this is even a relevant point. Are you saying > there is no valid solution that requires more than 20 lines of patch > code? I'm not sure, but it's what my gut feeling is. > How can you know that? Instinct :-) > > 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. > > > > If you read that directory, or attempt a lookup of some leaf node, the > > media will be revalidated. If there's new media in the drive, the > > normal partition handling code should be invoked, and thus the > > appropriate leaf nodes will be created. Take the media out, and the > > next readdir or lookup will remove partition entries (assuming the > > ide-floppy driver doesn't set the size back to 0). Magic. Just the way > > god^H^H^HI intended. > > Nope, grok_partitions does not cause existing entries to be removed, > unless the "size" is left at its original value, in which case your > system log will be filled with "unable to read partition table" > errors and errors from the ide layer trying to read non-existent > media. So, let me get this right (I haven't looked closely at ide-floppy, so bear with me): when there is no media present, the driver sets the size to zero at revalidate time, even if previously the size was non-zero? > > So, I've appended a patch which does this. Please try it out and let > > me know what you think. And hey! The patch is a mere 11 lines long. > > As noted in my other email (which I accidentally sent only to > Richard), this does not compile, and with minor changes it compiles > but Oopses my machine. It also addresses only a small part of the > problem. It was like a Linus "proof of concept patch": throw it together and let someone else test it. There were two stupid bugs. I've fixed those, after spending 2 minutes reviewing the code instead of 1 minute :-/ 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. > I really can't believe that it is so hard to get such a simple set > of patches incorporated that fix a multitude of problems. Once > again, I will list the existing problems as I see them; anyone else, > feel free to add items or tell me I'm hallucinating :-) Your patch was several pages long. That didn't give me the feeling it was "simple". > - 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 My patch should fix that. > - when media is ejected, invalid partition entries remain in the > directory Future work. > - when media is repartitioned, invalid partition entries remain in > the directory Future work, same solution as above. > - when media is reformatted, invalid partition entries remain in the > directory Future work, same solution as above. > - when ide-floppy (or ide-hd) modules are unloaded, the > disc/partition entries (and the directory) are not removed Future work. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca --- check.c~ Thu Oct 11 18:25:10 2001 +++ check.c Wed Dec 5 23:14:42 2001 @@ -383,6 +383,8 @@ 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; From owner-devfs@oss.sgi.com Wed Dec 5 23:58:22 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB67wMe19173 for devfs-outgoing; Wed, 5 Dec 2001 23:58:22 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB67wFo19169 for ; Wed, 5 Dec 2001 23:58:15 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB66wES22372; Wed, 5 Dec 2001 23:58:14 -0700 Date: Wed, 5 Dec 2001 23:58:14 -0700 Message-Id: <200112060658.fB66wES22372@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Brad Chapman Cc: devfs@oss.sgi.com Subject: Re: [IDEA] Enhanced trace level system In-Reply-To: <20010917111933.37053.qmail@web10903.mail.yahoo.com> References: <200109162342.f8GNgg308823@mobilix.ras.ucalgary.ca> <20010917111933.37053.qmail@web10903.mail.yahoo.com> Sender: owner-devfs@oss.sgi.com Precedence: bulk [Apologies for the late reply: I'm randomly going through my backlog] Brad Chapman writes: > Mr. Gooch, > > --- Richard Gooch wrote: > > Brad Chapman writes: > > > I just got an idea: why don't we implement a userspace trace level > > > system for devfsd with macro'd levels like the following: > > > > > > /* Basic trace levels */ > > > #define TRACE_LEVEL_ZERO 0 /* None */ > > > #define TRACE_LEVEL_SPECIFIED 1 /* Specified on the command line */ > > > #define TRACE_LEVEL_SIGNALS 2 /* Trapped and caught signals */ > > > #define TRACE_LEVEL_PROCESS_FORK 3 /* Process forks for MODLOAD and EXECUTE */ > > > #define TRACE_LEVEL_SERVICE_LOOP 4 /* devfs event service loops */ > > > #define TRACE_LEVEL_CONFIG 5 /* devfsd configuration */ > > > #define TRACE_LEVEL_KERNEL 6 /* Kernel-passed information */ > > > > > > /* Debugging trace levels */ > > > #define TRACE_LEVEL_DEBUGGING 7 /* Basic debugging */ > > > #define TRACE_LEVEL_KERNEL_DBG 8 /* Kernel-passed information debugging */ > > > #define TRACE_LEVEL_CONFIG_DBG 9 /* Configuration debugging */ > > > #define TRACE_LEVEL_COMPAT_NAME_DBG 10 /* Compatiblity name debugging */ > > > #define TRACE_LEVEL_EXPRESSION_DBG 11 /* Regular expression debugging */ > > > > > > Does anyone think this is a good idea? > > > > It's not clear to me what some of these trace levels are, nor what is > > to be done with them. What is it you are trying to do, anyway? > > I'm trying to create a sort of tracing system where you can > specify a mask on the command line (or a simple integer) and get a > vareity of traced information about what devfsd is doing. The stuff > I printed above was just an example of an incremental trace level > system. It's making things more complex than I'm happy with. I don't want the code riddled with more debugging output. > > Also note that I'm not keen on adding code to the core of devfsd > > unless necessary. So I'd look more favourably on an extension. > > Extension? What sort of extension? How would you extend > devfsd's tracing subsystem without actually modifying the core code? > IDGT..... I was thinking that if you wanted to capture and log events, you could call into a special extension which could pull apart the event structure and show all the information you wanted. That would give you a lot of tracing information. It wouldn't give you all the information about the internal workings of devfsd, but: - there a fair bit of that already - I'm not happy with increasing it. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Dec 6 15:51:08 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB6Np8g02913 for devfs-outgoing; Thu, 6 Dec 2001 15:51:08 -0800 Received: from calvin.paulbristow.lan (ppp488-cwdsl.fr.cw.net [62.210.101.233]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB6Nopo02908 for ; Thu, 6 Dec 2001 15:50:51 -0800 Received: from paulbristow.net (zoltar [192.168.30.10]) by calvin.paulbristow.lan (8.9.3/8.8.7) with ESMTP id AAA09817; Fri, 7 Dec 2001 00:07:25 +0100 Message-ID: <3C0FED36.9050506@paulbristow.net> Date: Thu, 06 Dec 2001 23:12:06 +0100 From: Paul Bristow User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010914 X-Accept-Language: en-us MIME-Version: 1.0 To: Richard Gooch CC: "Kevin P. Fleming" , Andrej.Borsenkow@mow.siemens.ru, mfedyk@matchmail.com, devfs@oss.sgi.com Subject: Re: Removeable Media, partitions and devfs? 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> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-devfs@oss.sgi.com Precedence: bulk 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. >>> >>>If you read that directory, or attempt a lookup of some leaf node, the >>>media will be revalidated. If there's new media in the drive, the >>>normal partition handling code should be invoked, and thus the >>>appropriate leaf nodes will be created. Take the media out, and the >>>next readdir or lookup will remove partition entries (assuming the >>>ide-floppy driver doesn't set the size back to 0). Magic. Just the way >>>god^H^H^HI intended. >>> >>Nope, grok_partitions does not cause existing entries to be removed, >>unless the "size" is left at its original value, in which case your >>system log will be filled with "unable to read partition table" >>errors and errors from the ide layer trying to read non-existent >>media. >> > > So, let me get this right (I haven't looked closely at ide-floppy, so > bear with me): when there is no media present, the driver sets the > size to zero at revalidate time, even if previously the size was > non-zero? 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 >> > > My patch should fix that. 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 >> > > Future work. > > >>- when media is repartitioned, invalid partition entries remain in >>the directory >> > > Future work, same solution as above. > > >>- when media is reformatted, invalid partition entries remain in the >>directory >> > > Future work, same solution as above. > > >>- when ide-floppy (or ide-hd) modules are unloaded, the >>disc/partition entries (and the directory) are not removed >> > > Future work. > > Regards, > > Richard.... > Permanent: rgooch@atnf.csiro.au > Current: rgooch@ras.ucalgary.ca -- Paul Email: paul@paulbristow.net 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; From owner-devfs@oss.sgi.com Fri Dec 7 00:08:55 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB788tC21347 for devfs-outgoing; Fri, 7 Dec 2001 00:08:55 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB788fo21338 for ; Fri, 7 Dec 2001 00:08:41 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB778bo09456; Fri, 7 Dec 2001 00:08:37 -0700 Date: Fri, 7 Dec 2001 00:08:37 -0700 Message-Id: <200112070708.fB778bo09456@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Paul Bristow Cc: "Kevin P. Fleming" , Andrej.Borsenkow@mow.siemens.ru, mfedyk@matchmail.com, devfs@oss.sgi.com Subject: Re: Removeable Media, partitions and devfs? In-Reply-To: <3C0FED36.9050506@paulbristow.net> 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> <3C0FED36.9050506@paulbristow.net> Sender: owner-devfs@oss.sgi.com Precedence: bulk Paul Bristow writes: > > 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 :-) Obviously, you haven't received email from Al :-) I knew that ide-floppy was setting GENHD_FL_REMOVABLE (I put it in there in the first place, IIRC), and that's all that should have been necessary. I designed that flag that way. So I figured that whatever the bug was, it was probably something stupid and simple. > >>>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. > >>> > >>>If you read that directory, or attempt a lookup of some leaf node, the > >>>media will be revalidated. If there's new media in the drive, the > >>>normal partition handling code should be invoked, and thus the > >>>appropriate leaf nodes will be created. Take the media out, and the > >>>next readdir or lookup will remove partition entries (assuming the > >>>ide-floppy driver doesn't set the size back to 0). Magic. Just the way > >>>god^H^H^HI intended. > >>> > >>Nope, grok_partitions does not cause existing entries to be removed, > >>unless the "size" is left at its original value, in which case your > >>system log will be filled with "unable to read partition table" > >>errors and errors from the ide layer trying to read non-existent > >>media. > >> > > > > So, let me get this right (I haven't looked closely at ide-floppy, so > > bear with me): when there is no media present, the driver sets the > > size to zero at revalidate time, even if previously the size was > > non-zero? > > At the moment no. But it could :-) Oh. So then the current situation is this: - driver loaded without media -> size==0 - driver loaded with media -> size!=0 - revalidate with media -> size!=0. Correct? So what happens now on revalidate without media? Let's say the sequence was: - insert media - load driver - remove media - revalidate. What does the driver do to indicate there is no media? > > 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 Ah, shit. Another stupid bug. You didn't even need to shift the first_minor variable. Better patch appended. > >>- 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 > >> > > > > My patch should fix that. > > The patch does fix this, by creating the disc entries regardless. Which is consistent with other removable media devices, I think (not that I've ever had the hardware to check this). The main thing is that the directory is created, with the DEVFS_FL_REMOVABLE flag set on an entry in that directory. > 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 ??? devfs_register_disc() should have created the "disc" entry with the DEVFS_FL_REMOVABLE flag. That in turn means that the directory is tagged as having removable media. So when you do an inode lookup or a readdir(3) on the directory, a media revalidation is performed. Please put in a printk() in fs/devfs/base.c to see what's happening. Look for how check_disc_changed() is being called. > The following items should be future work that we will fix during > 2.5. I hope a few simple tweaks to fs/partitions/check.c should fix it, in which case it's a 2.4 thing. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca --- check.c~ Thu Oct 11 18:25:10 2001 +++ check.c Thu Dec 6 23:49:54 2001 @@ -383,6 +383,8 @@ dev->part[first_minor].nr_sects = size; /* No such device or no minors to use for partitions */ + if ( !size && dev->flags && (dev->flags[drive] & GENHD_FL_REMOVABLE) ) + devfs_register_disc (dev, first_minor); if (!size || minors == 1) return; From owner-devfs@oss.sgi.com Fri Dec 7 05:50:09 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB7Do9307220 for devfs-outgoing; Fri, 7 Dec 2001 05:50:09 -0800 Received: from david.siemens.de (david.siemens.de [192.35.17.14]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB7Do2o07216 for ; Fri, 7 Dec 2001 05:50:03 -0800 Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by david.siemens.de (8.11.6/8.11.6) with ESMTP id fB7CnoS01443 for ; Fri, 7 Dec 2001 13:49:50 +0100 (MET) Received: from mowp002a.mowp.siemens.ru (mowp002a.mowp.siemens.ru [149.202.148.230]) by mail2.siemens.de (8.11.6/8.11.6) with ESMTP id fB7Cnng14113 for ; Fri, 7 Dec 2001 13:49:49 +0100 (MET) Received: by mowp002a.mowp.siemens.ru with Internet Mail Service (5.5.2653.19) id ; Fri, 7 Dec 2001 15:52:24 +0300 Received: from mw1g17c (mw1g17c.mow.siemens.ru [149.202.201.33]) by MOWD019A.mow.siemens.ru with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id YMPSJQ9N; Fri, 7 Dec 2001 15:50:15 +0300 From: Borsenkow Andrej To: "'Richard Gooch'" , "'Paul Bristow'" Cc: "'Kevin P. Fleming'" , mfedyk@matchmail.com, devfs@oss.sgi.com Subject: RE: Removeable Media, partitions and devfs? Date: Fri, 7 Dec 2001 15:49:40 +0300 Message-ID: <000201c17f1d$a2dd5d40$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: <200112070708.fB778bo09456@vindaloo.ras.ucalgary.ca> Sender: owner-devfs@oss.sgi.com Precedence: bulk > > > 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 > > ??? devfs_register_disc() should have created the "disc" entry with > the DEVFS_FL_REMOVABLE flag. That in turn means that the directory is > tagged as having removable media. So when you do an inode lookup or a > readdir(3) on the directory, a media revalidation is performed. > Yes, that is the theory. But at least one user on Mandrake cooker list reported that this does not work with my old patch (that faked media size to force .../disc creation) so there must be some problem. It did work when I wrote this patch, somewhere around 2.4.8 (shortly after Mdk8.1 was released). -andrej From owner-devfs@oss.sgi.com Fri Dec 7 10:52:02 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB7Iq2o18266 for devfs-outgoing; Fri, 7 Dec 2001 10:52:02 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB7Ipdo18260 for ; Fri, 7 Dec 2001 10:51:39 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB7HigM16383; Fri, 7 Dec 2001 10:44:42 -0700 Date: Fri, 7 Dec 2001 10:44:42 -0700 Message-Id: <200112071744.fB7HigM16383@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Borsenkow Andrej Cc: "'Paul Bristow'" , "'Kevin P. Fleming'" , mfedyk@matchmail.com, devfs@oss.sgi.com Subject: RE: Removeable Media, partitions and devfs? In-Reply-To: <000201c17f1d$a2dd5d40$21c9ca95@mow.siemens.ru> References: <200112070708.fB778bo09456@vindaloo.ras.ucalgary.ca> <000201c17f1d$a2dd5d40$21c9ca95@mow.siemens.ru> Sender: owner-devfs@oss.sgi.com Precedence: bulk Borsenkow Andrej writes: > > > > > 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 > > > > ??? devfs_register_disc() should have created the "disc" entry with > > the DEVFS_FL_REMOVABLE flag. That in turn means that the directory is > > tagged as having removable media. So when you do an inode lookup or a > > readdir(3) on the directory, a media revalidation is performed. > > Yes, that is the theory. But at least one user on Mandrake cooker > list reported that this does not work with my old patch (that faked > media size to force .../disc creation) so there must be some > problem. It did work when I wrote this patch, somewhere around 2.4.8 > (shortly after Mdk8.1 was released). So something has broken since then. So someone with a removable media drive should go in and insert printk()'s so this problem can be tracked down. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Fri Dec 7 11:39:23 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB7JdNT19910 for devfs-outgoing; Fri, 7 Dec 2001 11:39:23 -0800 Received: from mail.labsysgrp.com (PHNX1-UBR2-4-hfc-0251-d1dae065.rdc1.az.coxatwork.com [209.218.224.101] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB7JdEo19890 for ; Fri, 7 Dec 2001 11:39:16 -0800 Received: from mail by mail.labsysgrp.com with scanned-ok (Exim 3.33 #1) id 16CPtp-0001nw-00 for devfs@oss.sgi.com; Fri, 07 Dec 2001 11:39:05 -0700 Received: from jeeves.kpf.internal ([192.168.170.1]) by mail.labsysgrp.com with esmtp (Exim 3.33 #1) id 16CPtk-0001n9-00; Fri, 07 Dec 2001 11:39:02 -0700 Received: from [192.168.170.200] (helo=kevin) by jeeves.kpf.internal with smtp (Exim 3.30 #1) id 16CPtU-0006E5-00; Fri, 07 Dec 2001 11:38:44 -0700 Message-ID: <010501c17f4f$3816d950$c8aaa8c0@kevin> From: "Kevin P. Fleming" To: "Richard Gooch" Cc: "Paul Bristow" , , , 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> Subject: Re: Removeable Media, partitions and devfs? Date: Fri, 7 Dec 2001 11:44:36 -0700 Organization: LSG, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-devfs@oss.sgi.com Precedence: bulk (sorry for the delay in responding, had to rebuild the server at my office over the last 48 hours :-() > > However, as I recall, at least one version of your patch completely > unregistered a disc and then re-registered it. That's definately the > wrong approach, as I've said before, because it opens up a race. The > same disc could end up with a different number in /dev/discs. > > Apologies if your patch doesn't do this now: I haven't looked > closely. That's partly because it's long, and I believe a short patch > should be fine. That's correct, it did do that at one time, but no longer does so. It originally did so only because the code fs/partitions/check.c does not allow for any finer control over the entries without being reorganized. And that does make the patch seem long, when in reality it's just changing three functions into four and documenting them. > > 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. > That's a reasonable approach, but please understand that I've already spent quite a bit of time trying to find another solution, and I don't think there is one. It boils down to this: right now, the block device driver is responsible for calling grok_partitions when it wants to get the partitions registered. As a side effect (with devfs in the kernel), the appropriate devfs entries get created. That's all grok_partitions is responsible for, and as a result it makes no specific attempt to remove unneeded partitions entries. It also seems reasonable to me that if the device driver knows when entries should be created, and has a specific function to call for that purpose, that it should also know when entries should be removed, and should have a function to call for that purpose. > > > - when media is ejected, invalid partition entries remain in the > > directory > > Future work. > > > - when media is repartitioned, invalid partition entries remain in > > the directory > > Future work, same solution as above. > > > - when media is reformatted, invalid partition entries remain in the > > directory > > Future work, same solution as above. > > > - when ide-floppy (or ide-hd) modules are unloaded, the > > disc/partition entries (and the directory) are not removed > > Future work. And please note that these problems are not removable-media specific (as best I can tell), so they really need to be addressed for devfs to work in a "logical" fashion. From owner-devfs@oss.sgi.com Fri Dec 7 11:41:26 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB7JfQ219970 for devfs-outgoing; Fri, 7 Dec 2001 11:41:26 -0800 Received: from mail.labsysgrp.com (PHNX1-UBR2-4-hfc-0251-d1dae065.rdc1.az.coxatwork.com [209.218.224.101] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB7JfOo19959 for ; Fri, 7 Dec 2001 11:41:24 -0800 Received: from mail by mail.labsysgrp.com with scanned-ok (Exim 3.33 #1) id 16CPvy-0001po-00 for devfs@oss.sgi.com; Fri, 07 Dec 2001 11:41:18 -0700 Received: from jeeves.kpf.internal ([192.168.170.1]) by mail.labsysgrp.com with esmtp (Exim 3.33 #1) id 16CPvu-0001p1-00; Fri, 07 Dec 2001 11:41:15 -0700 Received: from [192.168.170.200] (helo=kevin) by jeeves.kpf.internal with smtp (Exim 3.30 #1) id 16CPve-0006EA-00; Fri, 07 Dec 2001 11:40:58 -0700 Message-ID: <010b01c17f4f$87b478a0$c8aaa8c0@kevin> From: "Kevin P. Fleming" To: "Paul Bristow" , "Richard Gooch" Cc: , , 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> <3C0FED36.9050506@paulbristow.net> Subject: Re: Removeable Media, partitions and devfs? Date: Fri, 7 Dec 2001 11:46:49 -0700 Organization: LSG, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-devfs@oss.sgi.com Precedence: bulk > > So, let me get this right (I haven't looked closely at ide-floppy, so > > bear with me): when there is no media present, the driver sets the > > size to zero at revalidate time, even if previously the size was > > non-zero? > > > At the moment no. But it could :-) Are you sure that's a reasonable thing to do? It seems that the size variable should accurately reflect the size of the device at that moment, and if it doesn't who's to say that won't cause other side effects in the grok_partitions and related code in the future? Seems a bit risky to me, "overloading" this variable to make sure that the devfs code works in the way we all want it to. From owner-devfs@oss.sgi.com Sat Dec 8 10:50:38 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB8Ioc716531 for devfs-outgoing; Sat, 8 Dec 2001 10:50:38 -0800 Received: from mail.labsysgrp.com (PHNX1-UBR2-4-hfc-0251-d1dae065.rdc1.az.coxatwork.com [209.218.224.101] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB8IoIo16519 for ; Sat, 8 Dec 2001 10:50:32 -0800 Received: from mail by mail.labsysgrp.com with scanned-ok (Exim 3.33 #1) id 16Clc3-0002dL-00 for devfs@oss.sgi.com; Sat, 08 Dec 2001 10:50:11 -0700 Received: from jeeves.kpf.internal ([192.168.170.1]) by mail.labsysgrp.com with esmtp (Exim 3.33 #1) id 16Clbz-0002cY-00; Sat, 08 Dec 2001 10:50:08 -0700 Received: from [192.168.170.108] (helo=kevin) by jeeves.kpf.internal with smtp (Exim 3.30 #1) id 16Clbh-0001vO-00; Sat, 08 Dec 2001 10:49:49 -0700 Message-ID: <000701c18011$8f1b1280$6caaa8c0@kevin> From: "Kevin P. Fleming" To: "Richard Gooch" , "Paul Bristow" Cc: , , 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><3C0FED36.9050506@paulbristow.net> <200112070708.fB778bo09456@vindaloo.ras.ucalgary.ca> Subject: Re: Removeable Media, partitions and devfs? Date: Sat, 8 Dec 2001 10:55:44 -0700 Organization: LSG, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-devfs@oss.sgi.com Precedence: bulk > --- check.c~ Thu Oct 11 18:25:10 2001 > +++ check.c Thu Dec 6 23:49:54 2001 > @@ -383,6 +383,8 @@ > > dev->part[first_minor].nr_sects = size; > /* No such device or no minors to use for partitions */ > + if ( !size && dev->flags && (dev->flags[drive] & GENHD_FL_REMOVABLE) ) > + devfs_register_disc (dev, first_minor); > if (!size || minors == 1) > return; > I'm sorry to say that this patch does not seem to work for me. I applied it to 2.4.17-pre5, and installed the new kernel and rebooted with no media in my ZIP 250 drive. The drive did not show in either /dev/discs or /dev/ide at all. It _was_ found by the ide driver and ide-floppy driver (version 0.97.sv as shipped with 2.4.17-pre5), but did not show in up the /dev heirarchy anywhere. From owner-devfs@oss.sgi.com Sat Dec 8 18:40:30 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB92eUp25398 for devfs-outgoing; Sat, 8 Dec 2001 18:40:30 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB92eNo25392 for ; Sat, 8 Dec 2001 18:40:23 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB91eKR03405; Sat, 8 Dec 2001 18:40:20 -0700 Date: Sat, 8 Dec 2001 18:40:20 -0700 Message-Id: <200112090140.fB91eKR03405@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Brad Chapman Cc: devfs@oss.sgi.com Subject: Re: 2.5-style devfs userspace tree (was: Re: [IDEA] Enhanced trace level system) In-Reply-To: <20011207212221.25253.qmail@web20403.mail.yahoo.com> References: <200112060658.fB66wES22372@vindaloo.ras.ucalgary.ca> <20011207212221.25253.qmail@web20403.mail.yahoo.com> Sender: owner-devfs@oss.sgi.com Precedence: bulk Brad Chapman writes: > --- Richard Gooch wrote: > > Brad Chapman writes: > > > I'm trying to create a sort of tracing system where you can > > > specify a mask on the command line (or a simple integer) and get a > > > vareity of traced information about what devfsd is doing. The stuff > > > I printed above was just an example of an incremental trace level > > > system. > > > > It's making things more complex than I'm happy with. I don't want the > > code riddled with more debugging output. > > Why not? Having a view into the inner workings of devfsd > without having to read the code itself would be helpful. Because it will bloat the code. A lot. We don't do that in the kernel either. Critical system components should be compact and efficient. That means there can't be lots of debugging code. [...] > In the short time I've been following this list, I've noticed > your reluctance to include things which you believe would make > devfsd bloated, difficult to use, and could possibly break devfsd > horribly (and make work for yourself cleaning the mess > up). Therefore I'm proposing this: Create a newexperimental devfsd > tree which acts as a testing ground for wild devfsd ideas. > > With this tree, you can continue to be maintainer, or have > someone else do it (one name that comes to mind is Russell > Coker). The maintainer of the new tree would accept almost > _anything_, put it in the experimental tree, and allow people to > test it. If it explodes, then it's backed out and the submittor of > the patch tries again. If it works and is cool enough, then it gets > pushed to you for consideration. > > Do you think this is a good idea? It seems to work for the > kernel...... That's only of use if those "wild ideas" might eventually be accepted into the mainline. Further, it's a lot more work (eventual merging of the two codebases is a lot of work) for a project that, in the scheme of things, isn't anywhere near big or as important as the kernel. There isn't the need for that level of experimentation. Remember, Linux is Unix. If you want to fiddle with things at a low level, you need to be prepared to get your hands dirty. That means being prepared to read the source code. No amount of debugging information will ever displace the need to read the code. And if you can read the code, you can trivially insert a custom debugging statement. BTW: you might want to remove your netscape address from your signature. The mailing list anti-spam filters treat it as a forbidden keyword and dump the messages (I didn't set it up, but that's how the oss lists are done). Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Sat Dec 8 20:02:31 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB942VL26727 for devfs-outgoing; Sat, 8 Dec 2001 20:02:31 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB942Ko26723 for ; Sat, 8 Dec 2001 20:02:20 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB932Eq04597; Sat, 8 Dec 2001 20:02:14 -0700 Date: Sat, 8 Dec 2001 20:02:14 -0700 Message-Id: <200112090302.fB932Eq04597@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: "Kevin P. Fleming" Cc: "Paul Bristow" , , , Subject: Re: Removeable Media, partitions and devfs? In-Reply-To: <010501c17f4f$3816d950$c8aaa8c0@kevin> 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> <010501c17f4f$3816d950$c8aaa8c0@kevin> Sender: owner-devfs@oss.sgi.com Precedence: bulk Kevin P. Fleming writes: > > However, as I recall, at least one version of your patch completely > > unregistered a disc and then re-registered it. That's definately the > > wrong approach, as I've said before, because it opens up a race. The > > same disc could end up with a different number in /dev/discs. > > > > Apologies if your patch doesn't do this now: I haven't looked > > closely. That's partly because it's long, and I believe a short patch > > should be fine. > > That's correct, it did do that at one time, but no longer does > so. It originally did so only because the code fs/partitions/check.c > does not allow for any finer control over the entries without being > reorganized. And that does make the patch seem long, when in reality > it's just changing three functions into four and documenting them. As always, functional change patches and documentation change patches should be separated. Haven't you lurked on linux-kernel long enough to know Linus hates mixed patches? :-) I share the sentiment. > > 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. > > That's a reasonable approach, but please understand that I've > already spent quite a bit of time trying to find another solution, > and I don't think there is one. It boils down to this: right now, > the block device driver is responsible for calling grok_partitions > when it wants to get the partitions registered. As a side effect > (with devfs in the kernel), the appropriate devfs entries get > created. That's all grok_partitions is responsible for, and as a > result it makes no specific attempt to remove unneeded partitions > entries. It also seems reasonable to me that if the device driver > knows when entries should be created, and has a specific function to > call for that purpose, that it should also know when entries should > be removed, and should have a function to call for that purpose. I specifically want the drivers to have as little knowledge about this as possible. > > > - when media is ejected, invalid partition entries remain in the > > > directory > > > > Future work. > > > > > - when media is repartitioned, invalid partition entries remain in > > > the directory > > > > Future work, same solution as above. > > > > > - when media is reformatted, invalid partition entries remain in the > > > directory > > > > Future work, same solution as above. > > > > > - when ide-floppy (or ide-hd) modules are unloaded, the > > > disc/partition entries (and the directory) are not removed > > > > Future work. > > And please note that these problems are not removable-media specific > (as best I can tell), so they really need to be addressed for devfs > to work in a "logical" fashion. When I use fdisk to repartition a device, removed partitions disappear from devfs when I write the new partition table. It seems to me things work fine with non-removable media. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Sat Dec 8 20:04:04 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB9444f26768 for devfs-outgoing; Sat, 8 Dec 2001 20:04:04 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB9441o26765 for ; Sat, 8 Dec 2001 20:04:01 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB933vw04632; Sat, 8 Dec 2001 20:03:57 -0700 Date: Sat, 8 Dec 2001 20:03:57 -0700 Message-Id: <200112090303.fB933vw04632@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: "Kevin P. Fleming" Cc: "Paul Bristow" , , , Subject: Re: Removeable Media, partitions and devfs? In-Reply-To: <010b01c17f4f$87b478a0$c8aaa8c0@kevin> 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> <3C0FED36.9050506@paulbristow.net> <010b01c17f4f$87b478a0$c8aaa8c0@kevin> Sender: owner-devfs@oss.sgi.com Precedence: bulk Kevin P. Fleming writes: > > > So, let me get this right (I haven't looked closely at ide-floppy, so > > > bear with me): when there is no media present, the driver sets the > > > size to zero at revalidate time, even if previously the size was > > > non-zero? > > > > > > At the moment no. But it could :-) > > Are you sure that's a reasonable thing to do? It seems that the size > variable should accurately reflect the size of the device at that > moment, and if it doesn't who's to say that won't cause other side > effects in the grok_partitions and related code in the future? Seems > a bit risky to me, "overloading" this variable to make sure that the > devfs code works in the way we all want it to. Actually, that variable was already overloaded to stop grok_partitions() from reading a partition table. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Sat Dec 8 20:06:02 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB9462126809 for devfs-outgoing; Sat, 8 Dec 2001 20:06:02 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB945vo26806 for ; Sat, 8 Dec 2001 20:05:58 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fB935r704671; Sat, 8 Dec 2001 20:05:53 -0700 Date: Sat, 8 Dec 2001 20:05:53 -0700 Message-Id: <200112090305.fB935r704671@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: "Kevin P. Fleming" Cc: "Paul Bristow" , , , Subject: Re: Removeable Media, partitions and devfs? In-Reply-To: <000701c18011$8f1b1280$6caaa8c0@kevin> 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> <3C0FED36.9050506@paulbristow.net> <200112070708.fB778bo09456@vindaloo.ras.ucalgary.ca> <000701c18011$8f1b1280$6caaa8c0@kevin> Sender: owner-devfs@oss.sgi.com Precedence: bulk Kevin P. Fleming writes: > > --- check.c~ Thu Oct 11 18:25:10 2001 > > +++ check.c Thu Dec 6 23:49:54 2001 > > @@ -383,6 +383,8 @@ > > > > dev->part[first_minor].nr_sects = size; > > /* No such device or no minors to use for partitions */ > > + if ( !size && dev->flags && (dev->flags[drive] & GENHD_FL_REMOVABLE) ) > > + devfs_register_disc (dev, first_minor); > > if (!size || minors == 1) > > return; > > > > I'm sorry to say that this patch does not seem to work for me. I > applied it to 2.4.17-pre5, and installed the new kernel and rebooted > with no media in my ZIP 250 drive. The drive did not show in either > /dev/discs or /dev/ide at all. It _was_ found by the ide driver and > ide-floppy driver (version 0.97.sv as shipped with 2.4.17-pre5), but > did not show in up the /dev heirarchy anywhere. Someone else reported having problems, and it looks to me like the media revalidation isn't working. It used to. Check the list archives, I asked for people to insert debugging printk()'s to find out what's going wrong. I don't have hardware to check this. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Sun Dec 9 07:07:38 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB9F7cT07754 for devfs-outgoing; Sun, 9 Dec 2001 07:07:38 -0800 Received: from david.siemens.de (david.siemens.de [192.35.17.14]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB9F7To07751 for ; Sun, 9 Dec 2001 07:07:29 -0800 Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by david.siemens.de (8.11.6/8.11.6) with ESMTP id fB9E7PS27435; Sun, 9 Dec 2001 15:07:25 +0100 (MET) Received: from MOWD019A.mow.siemens.ru ([139.24.18.3]) by mail1.siemens.de (8.11.6/8.11.6) with ESMTP id fB9E7O924711; Sun, 9 Dec 2001 15:07:24 +0100 (MET) Received: by mowd019a.mow.siemens.ru with Internet Mail Service (5.5.2653.19) id ; Sun, 9 Dec 2001 17:08:02 +0300 Received: from mw1g17c.mow.siemens.ru ([149.202.201.33]) by MOWD019A.mow.siemens.ru with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id Y3RNGFS5; Sun, 9 Dec 2001 17:07:59 +0300 From: Borsenkow Andrej To: Cooker list Cc: devfs mailing list , Mandrake kernel list Subject: RE: [Cooker] raw device & devfs In-Reply-To: <000301c17d61$bc4ff160$21c9ca95@mow.siemens.ru> References: <000301c17d61$bc4ff160$21c9ca95@mow.siemens.ru> Content-Type: multipart/mixed; boundary="=-1s+yqhnTLcjpkttcgY05" X-Mailer: Evolution/1.0 (Preview Release) Date: 09 Dec 2001 17:07:16 +0300 Message-Id: <1007906841.2207.0.camel@localhost.localdomain> Mime-Version: 1.0 Sender: owner-devfs@oss.sgi.com Precedence: bulk --=-1s+yqhnTLcjpkttcgY05 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On =D0=A1=D1=80=D0=B4, 2001-12-05 at 10:52, Borsenkow Andrej wrote: >=20 > >=20 > > [root@bononcini guillaume]# /etc/init.d/rawdevices start > > Affectation des p=C3=A9riph=C3=A9riques > > /dev/raw/raw1 --> /dev/hdc > > Cannot open master raw device '/dev/rawctl' (No such file or > directory) > > fini > >=20 >=20 > No wonder, there is no support for devfs in raw.c >=20 O.K., here is a patch that adds support for devfs to raw.c. It precreates /dev/raw/raw* nodes for all available minors; I do not particularly like it, but raw command needs existing devices to get minor number from; also, strictly speaking, all of them do exist as = soon as driver is loaded. Is it acceptable from devfs point of view? It seems to work here. Patch is against 2.4.16-4mdk Guillaume, could you test it? -andrej --=-1s+yqhnTLcjpkttcgY05 Content-Disposition: attachment; filename=raw.c.diff Content-Transfer-Encoding: quoted-printable Content-Type: text/x-diff; charset=KOI8-R --- raw.c.org Sun Sep 23 07:35:43 2001 +++ raw.c Sun Dec 9 14:44:01 2001 @@ -51,10 +51,25 @@ static int __init raw_init(void) { int i; - register_chrdev(RAW_MAJOR, "raw", &raw_fops); + static devfs_handle_t raw_devfs_handle; +=09 + devfs_register_chrdev(RAW_MAJOR, "raw", &raw_fops); + raw_devfs_handle =3D devfs_mk_dir(NULL, "raw", NULL); + devfs_register(NULL, "rawctl", DEVFS_FL_DEFAULT, + RAW_MAJOR, 0, + S_IFCHR|S_IRUSR|S_IWUSR, &raw_fops, NULL); =20 - for (i =3D 0; i < 256; i++) + for (i =3D 0; i < 256; i++) { + char name[8]; /* this depends on max minor number! */ init_MUTEX(&raw_devices[i].mutex); + if (i) { + /* skip minor 0 */ + sprintf(name, "raw%d", i); + devfs_register(raw_devfs_handle, name, DEVFS_FL_DEFAULT, + RAW_MAJOR, i, + S_IFCHR|S_IRUSR|S_IWUSR, &raw_fops, NULL); + } + } =20 return 0; } --=-1s+yqhnTLcjpkttcgY05-- From owner-devfs@oss.sgi.com Sun Dec 9 14:25:41 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB9MPft26158 for devfs-outgoing; Sun, 9 Dec 2001 14:25:41 -0800 Received: from mail.labsysgrp.com (PHNX1-UBR2-4-hfc-0251-d1dae065.rdc1.az.coxatwork.com [209.218.224.101] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB9MPVo24284 for ; Sun, 9 Dec 2001 14:25:33 -0800 Received: from mail by mail.labsysgrp.com with scanned-ok (Exim 3.33 #1) id 16DBRq-0007ND-00 for devfs@oss.sgi.com; Sun, 09 Dec 2001 14:25:22 -0700 Received: from jeeves.kpf.internal ([192.168.170.1]) by mail.labsysgrp.com with esmtp (Exim 3.33 #1) id 16DBRX-0007MQ-00; Sun, 09 Dec 2001 14:25:11 -0700 Received: from [192.168.170.108] (helo=kevin) by jeeves.kpf.internal with smtp (Exim 3.30 #1) id 16DBQY-0003Tf-00; Sun, 09 Dec 2001 14:24:02 -0700 Message-ID: <003401c180f8$ac3936c0$6caaa8c0@kevin> From: "Kevin P. Fleming" To: "Richard Gooch" Cc: "Paul Bristow" , , , 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><3C0FED36.9050506@paulbristow.net><200112070708.fB778bo09456@vindaloo.ras.ucalgary.ca><000701c18011$8f1b1280$6caaa8c0@kevin> <200112090305.fB935r704671@vindaloo.ras.ucalgary.ca> Subject: Re: Removeable Media, partitions and devfs? Date: Sun, 9 Dec 2001 14:30:07 -0700 Organization: LSG, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-devfs@oss.sgi.com Precedence: bulk > Someone else reported having problems, and it looks to me like the > media revalidation isn't working. It used to. Check the list > archives, I asked for people to insert debugging printk()'s to find > out what's going wrong. I don't have hardware to check this. > > Regards, > > Richard.... > Permanent: rgooch@atnf.csiro.au > Current: rgooch@ras.ucalgary.ca > OK, after a spending a few hours, here's what I've found (all based on 2.4.17-pre6): - ide-probe.c does not contain any code to set the "removable" flag for ide-floppy devices. the ide-floppy driver would carry it over into the gendisk structure if it was there... so after adding that, the previously posted patch _does_ cause the directory and whole-disc device to be created on my system, even with no media in the drive when the driver loads - when the removable flag set properly, devfs does appear to force a "media change" check on every readdir or access to the contents of the directory. unfortunately, ide-floppy currently contains (nearly) no media change logic. this makes the resulting behavior less than optimal :-) - yes, removing partitions does seem to get the device directory in sync now; I don't know when that changed, but it works even for removable media, so that problem is gone - ejecting and formatting media _would_ cause a revalidation to occur, if ide-floppy signaled that the media had been changed So, I spent a couple of hours getting some rudimentary media change logic into ide-floppy. It's not complete yet, but should be tomorrow. It will report a media change under any of the following circumstances: - the media was previously ejected - the media was previously formatted - the media is a different size than at the last media change check - the media is (now) unformatted but was at the last media change check - there is no media in the drive but was at the last media change check This should cover almost all cases, except for the most important one: when the user manually ejects the media and replaces it with identically sized media. There is no way to currently catch that, since the media is not serialized. There are ATA commands to monitor this sort of thing, but they will require Andre's new ide subsystem for implementation without tons of new code. Paul, I'll send you the patches I create for ide-floppy sometime tomorrow. Take a look at them and let me know what you like/dislike. Who wants to send in the ide-probe patch (it's a one-liner)? From owner-devfs@oss.sgi.com Mon Dec 10 13:35:35 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBALZZr16540 for devfs-outgoing; Mon, 10 Dec 2001 13:35:35 -0800 Received: from mail.labsysgrp.com (PHNX1-UBR2-4-hfc-0251-d1dae065.rdc1.az.coxatwork.com [209.218.224.101] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBALZSo16537 for ; Mon, 10 Dec 2001 13:35:28 -0800 Received: from mail by mail.labsysgrp.com with scanned-ok (Exim 3.33 #1) id 16DX90-0003XD-00 for devfs@oss.sgi.com; Mon, 10 Dec 2001 13:35:22 -0700 Received: from jeeves.kpf.internal ([192.168.170.1]) by mail.labsysgrp.com with esmtp (Exim 3.33 #1) id 16DX8v-0003Wa-00; Mon, 10 Dec 2001 13:35:19 -0700 Received: from [192.168.170.108] (helo=kevin) by jeeves.kpf.internal with smtp (Exim 3.30 #1) id 16DX8a-0005G9-00; Mon, 10 Dec 2001 13:34:56 -0700 Message-ID: <001501c181ba$fdb65650$6caaa8c0@kevin> From: "Kevin P. Fleming" To: "Richard Gooch" Cc: "Paul Bristow" , , 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><3C0FED36.9050506@paulbristow.net><010b01c17f4f$87b478a0$c8aaa8c0@kevin> <200112090303.fB933vw04632@vindaloo.ras.ucalgary.ca> Subject: Re: Removeable Media, partitions and devfs? Date: Mon, 10 Dec 2001 13:41:06 -0700 Organization: LSG, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-devfs@oss.sgi.com Precedence: bulk ----- Original Message ----- From: "Richard Gooch" To: "Kevin P. Fleming" Cc: "Paul Bristow" ; ; ; Sent: Saturday, December 08, 2001 8:03 PM Subject: Re: Removeable Media, partitions and devfs? > Kevin P. Fleming writes: > > > > So, let me get this right (I haven't looked closely at ide-floppy, so > > > > bear with me): when there is no media present, the driver sets the > > > > size to zero at revalidate time, even if previously the size was > > > > non-zero? > > > > > > > > > At the moment no. But it could :-) > > > > Are you sure that's a reasonable thing to do? It seems that the size > > variable should accurately reflect the size of the device at that > > moment, and if it doesn't who's to say that won't cause other side > > effects in the grok_partitions and related code in the future? Seems > > a bit risky to me, "overloading" this variable to make sure that the > > devfs code works in the way we all want it to. > > Actually, that variable was already overloaded to stop > grok_partitions() from reading a partition table. > OK, with the new ide-floppy media change detection, this is exactly what happens. If check_media_change gets called and there is currently no media in the drive, or unformatted media in the drive, then a "size" of 0 is passed to grok_partitions. This leads to existing partX entries not being removed, as grok_partitions does not make any attempt to update the partition information. If I forcibly pass a non-zero size, grok_partitions cleans up the old entries, but only after generating at least two IDE I/O errors in the system log as it tries to read the partition table from the disk. If I had other partition methods compiled in my kernel, I'm sure it would generate even more errors. Any suggestions on how you want see this handled? This is (somewhat) where I arrived previously, in that the driver knows that the partition entries need to be removed, but has no direct way to cause that to happen. Also, remember that we still have the problem where the disc directory and its entries are not removed when ide-floppy or ide-hd are unloaded, leading to an oops if you try to access any of those entries (since the ops pointers that devfs stored are no longer valid). From owner-devfs@oss.sgi.com Thu Dec 13 03:56:28 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBDBuS230402 for devfs-outgoing; Thu, 13 Dec 2001 03:56:28 -0800 Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBDBuOo30397 for ; Thu, 13 Dec 2001 03:56:24 -0800 Received: from silbermann.snv.jussieu.fr (silbermann.snv.jussieu.fr [134.157.138.163]) by shiva.jussieu.fr (8.12.1/jtpda-5.4) with ESMTP id fBDAsbYD056444 ; Thu, 13 Dec 2001 11:54:37 +0100 (CET) Received: by silbermann.snv.jussieu.fr (Postfix, from userid 501) id 8397D326; Thu, 13 Dec 2001 11:54:28 +0100 (CET) Content-Type: text/plain; charset="iso-8859-1" From: Guillaume Rousse Organization: =?iso8859-1?q?Universit=E9=20Pierre=20&=20Marie?= Curie To: cooker@linux-mandrake.com, Borsenkow Andrej Subject: Re: [Cooker] raw device & devfs Date: Thu, 13 Dec 2001 11:54:27 +0100 X-Mailer: KMail [version 1.3.2] Cc: devfs mailing list , Mandrake kernel list References: <000301c17d61$bc4ff160$21c9ca95@mow.siemens.ru> <1007906841.2207.0.camel@localhost.localdomain> In-Reply-To: <1007906841.2207.0.camel@localhost.localdomain> MIME-Version: 1.0 Message-Id: <20011213105428.8397D326@silbermann.snv.jussieu.fr> X-MIME-Autoconverted: from 8bit to quoted-printable by shiva.jussieu.fr id fBDAsbYD056444 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id fBDBuPo30399 Sender: owner-devfs@oss.sgi.com Precedence: bulk Ainsi parlait Borsenkow Andrej : > Patch is against 2.4.16-4mdk > > Guillaume, could you test it? I just tested it against 2.4.16-7mdk, it seems to be OK: [root@bononcini guillaume]# /etc/init.d/rawdevices start Affectation des périphériques /dev/raw/raw1 --> /dev/hdc /dev/raw/raw1: bound to major 22, minor 0 fini [root@bononcini guillaume]# /etc/init.d/rawdevices status /dev/raw/raw1: bound to major 22, minor 0 -- Guillaume Rousse GPG key http://lis.snv.jussieu.fr/~rousse/gpgkey.html From owner-devfs@oss.sgi.com Thu Dec 13 23:39:48 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBE7dm914834 for devfs-outgoing; Thu, 13 Dec 2001 23:39:48 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBE7dfo14831 for ; Thu, 13 Dec 2001 23:39:41 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fBE6dbL01653; Thu, 13 Dec 2001 23:39:37 -0700 Date: Thu, 13 Dec 2001 23:39:37 -0700 Message-Id: <200112140639.fBE6dbL01653@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: "Kevin P. Fleming" Cc: "Paul Bristow" , , , Subject: Re: Removeable Media, partitions and devfs? In-Reply-To: <003401c180f8$ac3936c0$6caaa8c0@kevin> 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> <3C0FED36.9050506@paulbristow.net> <200112070708.fB778bo09456@vindaloo.ras.ucalgary.ca> <000701c18011$8f1b1280$6caaa8c0@kevin> <200112090305.fB935r704671@vindaloo.ras.ucalgary.ca> <003401c180f8$ac3936c0$6caaa8c0@kevin> Sender: owner-devfs@oss.sgi.com Precedence: bulk Kevin P. Fleming writes: > > Someone else reported having problems, and it looks to me like the > > media revalidation isn't working. It used to. Check the list > > archives, I asked for people to insert debugging printk()'s to find > > out what's going wrong. I don't have hardware to check this. > > > > Regards, > > > > Richard.... > > Permanent: rgooch@atnf.csiro.au > > Current: rgooch@ras.ucalgary.ca > > > > > OK, after a spending a few hours, here's what I've found (all based on > 2.4.17-pre6): > > - ide-probe.c does not contain any code to set the "removable" flag for > ide-floppy devices. the ide-floppy driver would carry it over into the > gendisk structure if it was there... so after adding that, the previously > posted patch _does_ cause the directory and whole-disc device to be created > on my system, even with no media in the drive when the driver loads > > - when the removable flag set properly, devfs does appear to force a "media > change" check on every readdir or access to the contents of the directory. > unfortunately, ide-floppy currently contains (nearly) no media change logic. > this makes the resulting behavior less than optimal :-) > > - yes, removing partitions does seem to get the device directory in sync > now; I don't know when that changed, but it works even for removable media, > so that problem is gone > > - ejecting and formatting media _would_ cause a revalidation to occur, if > ide-floppy signaled that the media had been changed > > So, I spent a couple of hours getting some rudimentary media change logic > into ide-floppy. It's not complete yet, but should be tomorrow. It will > report a media change under any of the following circumstances: > > - the media was previously ejected > - the media was previously formatted > - the media is a different size than at the last media change check > - the media is (now) unformatted but was at the last media change check > - there is no media in the drive but was at the last media change check > > This should cover almost all cases, except for the most important > one: when the user manually ejects the media and replaces it with > identically sized media. There is no way to currently catch that, > since the media is not serialized. There are ATA commands to monitor > this sort of thing, but they will require Andre's new ide subsystem > for implementation without tons of new code. OK, so that's not a devfs-related problem, right? Changing calls to devfs won't help with this last problem? Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Dec 13 23:50:29 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBE7oTZ14936 for devfs-outgoing; Thu, 13 Dec 2001 23:50:29 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBE7oLo14933 for ; Thu, 13 Dec 2001 23:50:21 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fBE6oN201769; Thu, 13 Dec 2001 23:50:23 -0700 Date: Thu, 13 Dec 2001 23:50:23 -0700 Message-Id: <200112140650.fBE6oN201769@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: "Kevin P. Fleming" Cc: "Paul Bristow" , , Subject: Re: Removeable Media, partitions and devfs? In-Reply-To: <001501c181ba$fdb65650$6caaa8c0@kevin> 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> <3C0FED36.9050506@paulbristow.net> <010b01c17f4f$87b478a0$c8aaa8c0@kevin> <200112090303.fB933vw04632@vindaloo.ras.ucalgary.ca> <001501c181ba$fdb65650$6caaa8c0@kevin> Sender: owner-devfs@oss.sgi.com Precedence: bulk Kevin P. Fleming writes: > > ----- Original Message ----- > From: "Richard Gooch" > To: "Kevin P. Fleming" > Cc: "Paul Bristow" ; > ; ; > > Sent: Saturday, December 08, 2001 8:03 PM > Subject: Re: Removeable Media, partitions and devfs? > > > > Kevin P. Fleming writes: > > > > > So, let me get this right (I haven't looked closely at ide-floppy, > so > > > > > bear with me): when there is no media present, the driver sets the > > > > > size to zero at revalidate time, even if previously the size was > > > > > non-zero? > > > > > > > > > > > > At the moment no. But it could :-) > > > > > > Are you sure that's a reasonable thing to do? It seems that the size > > > variable should accurately reflect the size of the device at that > > > moment, and if it doesn't who's to say that won't cause other side > > > effects in the grok_partitions and related code in the future? Seems > > > a bit risky to me, "overloading" this variable to make sure that the > > > devfs code works in the way we all want it to. > > > > Actually, that variable was already overloaded to stop > > grok_partitions() from reading a partition table. > > > > OK, with the new ide-floppy media change detection, this is exactly > what happens. If check_media_change gets called and there is > currently no media in the drive, or unformatted media in the drive, > then a "size" of 0 is passed to grok_partitions. > > This leads to existing partX entries not being removed, as > grok_partitions does not make any attempt to update the partition > information. If I forcibly pass a non-zero size, grok_partitions > cleans up the old entries, but only after generating at least two > IDE I/O errors in the system log as it tries to read the partition > table from the disk. If I had other partition methods compiled in my > kernel, I'm sure it would generate even more errors. You shouldn't need to pass a non-zero size. That's what my tiny patch is meant to solve. If size==0 and the media is removable, it creates the device directory and "disc" entry, *without reading the partition table*. Thus there should be no errors. >From your previous message, it appeared that all but one problem (new media of the same size) was solved when using my patch. Is that not the case? > Any suggestions on how you want see this handled? This is (somewhat) > where I arrived previously, in that the driver knows that the > partition entries need to be removed, but has no direct way to cause > that to happen. Doesn't my patch fix this? > Also, remember that we still have the problem where the disc > directory and its entries are not removed when ide-floppy or ide-hd > are unloaded, leading to an oops if you try to access any of those > entries (since the ops pointers that devfs stored are no longer > valid). I thought that the generic IDE layer was handling directory removal? I note that ide_unregister() makes a call to devfs_unregister(). This appears to be called when an interface is unregistered. Is there some code path that is called when an IDE upper-level driver (i.e. hd, floppy, tape, etc.) is removed? If not, someone should add that. Who knows their way around the IDE code to know the best place to do this? Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Fri Dec 14 09:13:02 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBEHD2904512 for devfs-outgoing; Fri, 14 Dec 2001 09:13:02 -0800 Received: from mail.labsysgrp.com (PHNX1-UBR2-4-hfc-0251-d1dae065.rdc1.az.coxatwork.com [209.218.224.101] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBEHCpo04502 for ; Fri, 14 Dec 2001 09:13:00 -0800 Received: from mail by mail.labsysgrp.com with scanned-ok (Exim 3.33 #1) id 16Eux2-0007hb-00 for devfs@oss.sgi.com; Fri, 14 Dec 2001 09:12:44 -0700 Received: from jeeves.kpf.internal ([192.168.170.1]) by mail.labsysgrp.com with esmtp (Exim 3.33 #1) id 16Euwy-0007gn-00; Fri, 14 Dec 2001 09:12:41 -0700 Received: from [192.168.170.108] (helo=kevin) by jeeves.kpf.internal with smtp (Exim 3.30 #1) id 16EuwU-0000ae-00; Fri, 14 Dec 2001 09:12:10 -0700 Message-ID: <002e01c184ba$fc7cb7e0$6caaa8c0@kevin> From: "Kevin P. Fleming" To: "Richard Gooch" Cc: "Paul Bristow" , , , 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><3C0FED36.9050506@paulbristow.net><200112070708.fB778bo09456@vindaloo.ras.ucalgary.ca><000701c18011$8f1b1280$6caaa8c0@kevin><200112090305.fB935r704671@vindaloo.ras.ucalgary.ca><003401c180f8$ac3936c0$6caaa8c0@kevin> <200112140639.fBE6dbL01653@vindaloo.ras.ucalgary.ca> Subject: Re: Removeable Media, partitions and devfs? Date: Fri, 14 Dec 2001 09:18:37 -0700 Organization: LSG, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-devfs@oss.sgi.com Precedence: bulk > > This should cover almost all cases, except for the most important > > one: when the user manually ejects the media and replaces it with > > identically sized media. There is no way to currently catch that, > > since the media is not serialized. There are ATA commands to monitor > > this sort of thing, but they will require Andre's new ide subsystem > > for implementation without tons of new code. > > OK, so that's not a devfs-related problem, right? Changing calls to > devfs won't help with this last problem? > Right, this is not devfs-related. It is somewhat related, if we actually wanted the partition entries to disappear/reappear without the user having to force a readdir() of the device directory (which is what my original patch did), but that is no longer necessary. From owner-devfs@oss.sgi.com Fri Dec 14 09:20:45 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBEHKj704645 for devfs-outgoing; Fri, 14 Dec 2001 09:20:45 -0800 Received: from mail.labsysgrp.com (PHNX1-UBR2-4-hfc-0251-d1dae065.rdc1.az.coxatwork.com [209.218.224.101] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBEHKao04642 for ; Fri, 14 Dec 2001 09:20:36 -0800 Received: from mail by mail.labsysgrp.com with scanned-ok (Exim 3.33 #1) id 16Ev4Y-0007oT-00 for devfs@oss.sgi.com; Fri, 14 Dec 2001 09:20:30 -0700 Received: from jeeves.kpf.internal ([192.168.170.1]) by mail.labsysgrp.com with esmtp (Exim 3.33 #1) id 16Ev4T-0007nq-00; Fri, 14 Dec 2001 09:20:26 -0700 Received: from [192.168.170.108] (helo=kevin) by jeeves.kpf.internal with smtp (Exim 3.30 #1) id 16Ev3x-0000ax-00; Fri, 14 Dec 2001 09:19:53 -0700 Message-ID: <003401c184bc$107efb80$6caaa8c0@kevin> From: "Kevin P. Fleming" To: "Richard Gooch" Cc: "Paul Bristow" , , 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><3C0FED36.9050506@paulbristow.net><010b01c17f4f$87b478a0$c8aaa8c0@kevin><200112090303.fB933vw04632@vindaloo.ras.ucalgary.ca><001501c181ba$fdb65650$6caaa8c0@kevin> <200112140650.fBE6oN201769@vindaloo.ras.ucalgary.ca> Subject: Re: Removeable Media, partitions and devfs? Date: Fri, 14 Dec 2001 09:26:20 -0700 Organization: LSG, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-devfs@oss.sgi.com Precedence: bulk > > This leads to existing partX entries not being removed, as > > grok_partitions does not make any attempt to update the partition > > information. If I forcibly pass a non-zero size, grok_partitions > > cleans up the old entries, but only after generating at least two > > IDE I/O errors in the system log as it tries to read the partition > > table from the disk. If I had other partition methods compiled in my > > kernel, I'm sure it would generate even more errors. > > You shouldn't need to pass a non-zero size. That's what my tiny patch > is meant to solve. If size==0 and the media is removable, it creates > the device directory and "disc" entry, *without reading the partition > table*. Thus there should be no errors. > That patch only has an effect when the drive is originally registered; calling devfs_register_disc later does _not_ cause existing partition entries to be removed. Once the directory has been created, devfs_register_disc seems to be a no-op. > From your previous message, it appeared that all but one problem (new > media of the same size) was solved when using my patch. Is that not > the case? A bit of oversimplification; my previous message said that my new ide-floppy code could catch almost all media change events. That does not mean, however, that I have the ability to get the right thing done in the device directory for every possible type of event. > > > Any suggestions on how you want see this handled? This is (somewhat) > > where I arrived previously, in that the driver knows that the > > partition entries need to be removed, but has no direct way to cause > > that to happen. > > Doesn't my patch fix this? Nope, existing entries don't go away when devfs_register_disc gets called for the second (or subsequent) times. > > > Also, remember that we still have the problem where the disc > > directory and its entries are not removed when ide-floppy or ide-hd > > are unloaded, leading to an oops if you try to access any of those > > entries (since the ops pointers that devfs stored are no longer > > valid). > > I thought that the generic IDE layer was handling directory removal? > I note that ide_unregister() makes a call to devfs_unregister(). This > appears to be called when an interface is unregistered. Is there some > code path that is called when an IDE upper-level driver (i.e. hd, > floppy, tape, etc.) is removed? If not, someone should add that. > Who knows their way around the IDE code to know the best place to do > this? This is true, the IDE subsystem would remove the directories if the _interface_ got removed, but unloading ide-floppy or ide-hd does not remove the _interface_, only the driver handling the device(s) attached via that interface. Yes, this should be handled by the upper layer of the IDE subsystem, and I'll try to find a way to make that happen. However, with the way that things stand right now, the IDE subsystem will still need some way to tell devfs to unregister all the entries in the device directory, _without_ removing the device directory itself. If the device directory got removed, then there wouldn't be any code to recreate it when a module got loaded later. Here's the sequence of events, just to refresh your memory: - ide module registers /dev/ide - ide module calls ide-probe, which registers all the /dev/ide/hostX/busX/lunX directories - ide module calls ide-hd, ide-floppy, ide-cd (if not modules), and they create entries _inside_ the lunX directories and /dev/discs or /dev/cdroms links - if ide module (top layer) is unloaded, all this disappears (as it should) - if ide-hd, ide-floppy or ide-cd get unloaded, their entries inside the lunX directories don't get removed, because the IDE major device is still present From owner-devfs@oss.sgi.com Fri Dec 14 11:10:27 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBEJARv06155 for devfs-outgoing; Fri, 14 Dec 2001 11:10:27 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBEJA5o06104 for ; Fri, 14 Dec 2001 11:10:05 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fBEIA6k05971; Fri, 14 Dec 2001 11:10:06 -0700 Date: Fri, 14 Dec 2001 11:10:06 -0700 Message-Id: <200112141810.fBEIA6k05971@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: "Kevin P. Fleming" Cc: "Paul Bristow" , , Subject: Re: Removeable Media, partitions and devfs? In-Reply-To: <003401c184bc$107efb80$6caaa8c0@kevin> 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> <3C0FED36.9050506@paulbristow.net> <010b01c17f4f$87b478a0$c8aaa8c0@kevin> <200112090303.fB933vw04632@vindaloo.ras.ucalgary.ca> <001501c181ba$fdb65650$6caaa8c0@kevin> <200112140650.fBE6oN201769@vindaloo.ras.ucalgary.ca> <003401c184bc$107efb80$6caaa8c0@kevin> Sender: owner-devfs@oss.sgi.com Precedence: bulk Kevin P. Fleming writes: > > > This leads to existing partX entries not being removed, as > > > grok_partitions does not make any attempt to update the partition > > > information. If I forcibly pass a non-zero size, grok_partitions > > > cleans up the old entries, but only after generating at least two > > > IDE I/O errors in the system log as it tries to read the partition > > > table from the disk. If I had other partition methods compiled in my > > > kernel, I'm sure it would generate even more errors. > > > > You shouldn't need to pass a non-zero size. That's what my tiny patch > > is meant to solve. If size==0 and the media is removable, it creates > > the device directory and "disc" entry, *without reading the partition > > table*. Thus there should be no errors. > > That patch only has an effect when the drive is originally registered; > calling devfs_register_disc later does _not_ cause existing partition > entries to be removed. Once the directory has been created, > devfs_register_disc seems to be a no-op. > > > From your previous message, it appeared that all but one problem (new > > media of the same size) was solved when using my patch. Is that not > > the case? > > A bit of oversimplification; my previous message said that my new > ide-floppy code could catch almost all media change events. That > does not mean, however, that I have the ability to get the right > thing done in the device directory for every possible type of event. Ah. In this case: partitions aren't being unregistered properly. > > > Any suggestions on how you want see this handled? This is (somewhat) > > > where I arrived previously, in that the driver knows that the > > > partition entries need to be removed, but has no direct way to cause > > > that to happen. > > > > Doesn't my patch fix this? > > Nope, existing entries don't go away when devfs_register_disc gets > called for the second (or subsequent) times. OK, I've looked at this, and the appended patch should fix this. This superceeds my earlier patch. Now, if the driver passes size==0 and it flags the media as removable, then the device directory and "disc" entry will be created (if not already), and any old partitions are removed. Please try this out and let me know how it goes. I hope it works, because I've hit the 20 line patch limit I imposed :-) Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca --- check.c~ Thu Oct 11 18:25:10 2001 +++ check.c Fri Dec 14 11:02:19 2001 @@ -338,7 +338,8 @@ if (!unregister) devfs_register_disc (dev, minor); for (part = 1; part < dev->max_p; part++) { - if ( unregister || (dev->part[part + minor].nr_sects < 1) ) { + if ( unregister || (dev->part[minor].nr_sects < 1) || + (dev->part[part + minor].nr_sects < 1) ) { devfs_unregister (dev->part[part + minor].de); dev->part[part + minor].de = NULL; continue; @@ -383,6 +384,8 @@ dev->part[first_minor].nr_sects = size; /* No such device or no minors to use for partitions */ + if ( !size && dev->flags && (dev->flags[drive] & GENHD_FL_REMOVABLE) ) + devfs_register_partitions (dev, first_minor, 0); if (!size || minors == 1) return; From owner-devfs@oss.sgi.com Sat Dec 15 10:28:20 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBFISKx23407 for devfs-outgoing; Sat, 15 Dec 2001 10:28:20 -0800 Received: from mail.labsysgrp.com (PHNX1-UBR2-4-hfc-0251-d1dae065.rdc1.az.coxatwork.com [209.218.224.101] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBFISBo23403 for ; Sat, 15 Dec 2001 10:28:12 -0800 Received: from mail by mail.labsysgrp.com with scanned-ok (Exim 3.33 #1) id 16FIbU-0002uH-00 for devfs@oss.sgi.com; Sat, 15 Dec 2001 10:28:04 -0700 Received: from jeeves.kpf.internal ([192.168.170.1]) by mail.labsysgrp.com with esmtp (Exim 3.33 #1) id 16FIbO-0002te-00; Sat, 15 Dec 2001 10:27:59 -0700 Received: from [192.168.170.108] (helo=kevin) by jeeves.kpf.internal with smtp (Exim 3.30 #1) id 16FIaq-0002CA-00; Sat, 15 Dec 2001 10:27:24 -0700 Message-ID: <000b01c1858e$acd2c930$6caaa8c0@kevin> From: "Kevin P. Fleming" To: "Richard Gooch" Cc: "Paul Bristow" , , 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><3C0FED36.9050506@paulbristow.net><010b01c17f4f$87b478a0$c8aaa8c0@kevin><200112090303.fB933vw04632@vindaloo.ras.ucalgary.ca><001501c181ba$fdb65650$6caaa8c0@kevin><200112140650.fBE6oN201769@vindaloo.ras.ucalgary.ca><003401c184bc$107efb80$6caaa8c0@kevin> <200112141810.fBEIA6k05971@vindaloo.ras.ucalgary.ca> Subject: Re: Removeable Media, partitions and devfs? Date: Sat, 15 Dec 2001 10:33:57 -0700 Organization: LSG, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-devfs@oss.sgi.com Precedence: bulk > OK, I've looked at this, and the appended patch should fix this. This > superceeds my earlier patch. Now, if the driver passes size==0 and it > flags the media as removable, then the device directory and "disc" > entry will be created (if not already), and any old partitions are > removed. Please try this out and let me know how it goes. I hope it > works, because I've hit the 20 line patch limit I imposed :-) > > Regards, > > Richard.... > Permanent: rgooch@atnf.csiro.au > Current: rgooch@ras.ucalgary.ca > > --- check.c~ Thu Oct 11 18:25:10 2001 > +++ check.c Fri Dec 14 11:02:19 2001 > @@ -338,7 +338,8 @@ > if (!unregister) > devfs_register_disc (dev, minor); > for (part = 1; part < dev->max_p; part++) { > - if ( unregister || (dev->part[part + minor].nr_sects < 1) ) { > + if ( unregister || (dev->part[minor].nr_sects < 1) || > + (dev->part[part + minor].nr_sects < 1) ) { > devfs_unregister (dev->part[part + minor].de); > dev->part[part + minor].de = NULL; > continue; > @@ -383,6 +384,8 @@ > > dev->part[first_minor].nr_sects = size; > /* No such device or no minors to use for partitions */ > + if ( !size && dev->flags && (dev->flags[drive] & GENHD_FL_REMOVABLE) ) > + devfs_register_partitions (dev, first_minor, 0); > if (!size || minors == 1) > return; > Sorry, this code never gets called... grok_partitions doesn't call check_partition when "size" is zero, and check_partition is the only function that calls devfs_register_partitions, which is where this change was made. Want to make another attempt? :-) From owner-devfs@oss.sgi.com Sat Dec 15 10:56:04 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBFIu4p23718 for devfs-outgoing; Sat, 15 Dec 2001 10:56:04 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBFItwo23714 for ; Sat, 15 Dec 2001 10:55:58 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fBFHuCH15168; Sat, 15 Dec 2001 10:56:12 -0700 Date: Sat, 15 Dec 2001 10:56:12 -0700 Message-Id: <200112151756.fBFHuCH15168@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: "Kevin P. Fleming" Cc: "Paul Bristow" , , Subject: Re: Removeable Media, partitions and devfs? In-Reply-To: <000b01c1858e$acd2c930$6caaa8c0@kevin> 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> <3C0FED36.9050506@paulbristow.net> <010b01c17f4f$87b478a0$c8aaa8c0@kevin> <200112090303.fB933vw04632@vindaloo.ras.ucalgary.ca> <001501c181ba$fdb65650$6caaa8c0@kevin> <200112140650.fBE6oN201769@vindaloo.ras.ucalgary.ca> <003401c184bc$107efb80$6caaa8c0@kevin> <200112141810.fBEIA6k05971@vindaloo.ras.ucalgary.ca> <000b01c1858e$acd2c930$6caaa8c0@kevin> Sender: owner-devfs@oss.sgi.com Precedence: bulk Kevin P. Fleming writes: > > OK, I've looked at this, and the appended patch should fix this. This > > superceeds my earlier patch. Now, if the driver passes size==0 and it > > flags the media as removable, then the device directory and "disc" > > entry will be created (if not already), and any old partitions are > > removed. Please try this out and let me know how it goes. I hope it > > works, because I've hit the 20 line patch limit I imposed :-) > > > > Regards, > > > > Richard.... > > Permanent: rgooch@atnf.csiro.au > > Current: rgooch@ras.ucalgary.ca > > > > --- check.c~ Thu Oct 11 18:25:10 2001 > > +++ check.c Fri Dec 14 11:02:19 2001 > > @@ -338,7 +338,8 @@ > > if (!unregister) > > devfs_register_disc (dev, minor); > > for (part = 1; part < dev->max_p; part++) { > > - if ( unregister || (dev->part[part + minor].nr_sects < 1) ) { > > + if ( unregister || (dev->part[minor].nr_sects < 1) || > > + (dev->part[part + minor].nr_sects < 1) ) { > > devfs_unregister (dev->part[part + minor].de); > > dev->part[part + minor].de = NULL; > > continue; > > @@ -383,6 +384,8 @@ > > > > dev->part[first_minor].nr_sects = size; > > /* No such device or no minors to use for partitions */ > > + if ( !size && dev->flags && (dev->flags[drive] & GENHD_FL_REMOVABLE) ) > > + devfs_register_partitions (dev, first_minor, 0); > > if (!size || minors == 1) > > return; > > Sorry, this code never gets called... grok_partitions doesn't call > check_partition when "size" is zero, and check_partition is the only > function that calls devfs_register_partitions, which is where this > change was made. Want to make another attempt? :-) ?!?!?!? My patch has two hunks. One which modifies devfs_register_partitions(), and another which modifies grok_partitions() to call devfs_register_partitions() when size==0 for removable media devices. This should work. Did you actually try this? Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Sat Dec 15 14:37:26 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBFMbQ627039 for devfs-outgoing; Sat, 15 Dec 2001 14:37:26 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBFMbLo27034 for ; Sat, 15 Dec 2001 14:37:21 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fBFLbaU17467; Sat, 15 Dec 2001 14:37:36 -0700 Date: Sat, 15 Dec 2001 14:37:36 -0700 Message-Id: <200112152137.fBFLbaU17467@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v199.4 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 199.4 of my devfs patch is now available from: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html The devfs FAQ is also available here. Patch directly available from: ftp://ftp.??.kernel.org/pub/linux/kernel/people/rgooch/v2.4/devfs-patch-current.gz AND: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/kernel-patches/v2.4/devfs-patch-current.gz This is against 2.4.17-rc1. Highlights of this release: - Removed long obsolete rc.devfs - Return old entry in for 2.4.x kernels - Updated README from master HTML file - Increment refcount on module in - Created and exported - Increment refcount on module in - Created and used where needed to fix races Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Sat Dec 15 22:19:23 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBG6JN003999 for devfs-outgoing; Sat, 15 Dec 2001 22:19:23 -0800 Received: from mail.labsysgrp.com (PHNX1-UBR2-4-hfc-0251-d1dae065.rdc1.az.coxatwork.com [209.218.224.101] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBG6JIo03996 for ; Sat, 15 Dec 2001 22:19:18 -0800 Received: from mail by mail.labsysgrp.com with scanned-ok (Exim 3.33 #1) id 16FThf-00048S-00 for devfs@oss.sgi.com; Sat, 15 Dec 2001 22:19:11 -0700 Received: from jeeves.kpf.internal ([192.168.170.1]) by mail.labsysgrp.com with esmtp (Exim 3.33 #1) id 16FTha-00047p-00; Sat, 15 Dec 2001 22:19:09 -0700 Received: from [192.168.170.108] (helo=kevin) by jeeves.kpf.internal with smtp (Exim 3.30 #1) id 16FLwE-0002f6-00; Sat, 15 Dec 2001 14:01:42 -0700 Message-ID: <001001c185ac$9c6ca700$6caaa8c0@kevin> From: "Kevin P. Fleming" To: "Richard Gooch" Cc: "Paul Bristow" , , 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><3C0FED36.9050506@paulbristow.net><010b01c17f4f$87b478a0$c8aaa8c0@kevin><200112090303.fB933vw04632@vindaloo.ras.ucalgary.ca><001501c181ba$fdb65650$6caaa8c0@kevin><200112140650.fBE6oN201769@vindaloo.ras.ucalgary.ca><003401c184bc$107efb80$6caaa8c0@kevin><200112141810.fBEIA6k05971@vindaloo.ras.ucalgary.ca><000b01c1858e$acd2c930$6caaa8c0@kevin> <200112151756.fBFHuCH15168@vindaloo.ras.ucalgary.ca> Subject: Re: Removeable Media, partitions and devfs? Date: Sat, 15 Dec 2001 14:08:14 -0700 Organization: LSG, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-devfs@oss.sgi.com Precedence: bulk > > > --- check.c~ Thu Oct 11 18:25:10 2001 > > > +++ check.c Fri Dec 14 11:02:19 2001 > > > @@ -338,7 +338,8 @@ > > > if (!unregister) > > > devfs_register_disc (dev, minor); > > > for (part = 1; part < dev->max_p; part++) { > > > - if ( unregister || (dev->part[part + minor].nr_sects < 1) ) { > > > + if ( unregister || (dev->part[minor].nr_sects < 1) || > > > + (dev->part[part + minor].nr_sects < 1) ) { > > > devfs_unregister (dev->part[part + minor].de); > > > dev->part[part + minor].de = NULL; > > > continue; > > > @@ -383,6 +384,8 @@ > > > > > > dev->part[first_minor].nr_sects = size; > > > /* No such device or no minors to use for partitions */ > > > + if ( !size && dev->flags && (dev->flags[drive] & GENHD_FL_REMOVABLE) ) > > > + devfs_register_partitions (dev, first_minor, 0); > > > if (!size || minors == 1) > > > return; > > > > Sorry, this code never gets called... grok_partitions doesn't call > > check_partition when "size" is zero, and check_partition is the only > > function that calls devfs_register_partitions, which is where this > > change was made. Want to make another attempt? :-) > > ?!?!?!? My patch has two hunks. One which modifies > devfs_register_partitions(), and another which modifies > grok_partitions() to call devfs_register_partitions() when size==0 for > removable media devices. This should work. > > Did you actually try this? > > Regards, > > Richard.... > Permanent: rgooch@atnf.csiro.au > Current: rgooch@ras.ucalgary.ca > Yes, I tried it, except I assumed the second part of the patch was the same as it was previously... calling devfs_register_disc. I see now that it has been changed... I'll try the new version. Sorry for the confusion. From owner-devfs@oss.sgi.com Sun Dec 16 18:22:00 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBH2M0b04043 for devfs-outgoing; Sun, 16 Dec 2001 18:22:00 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBH2Lso04040 for ; Sun, 16 Dec 2001 18:21:54 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fBH1Ldp32763; Sun, 16 Dec 2001 18:21:39 -0700 Date: Sun, 16 Dec 2001 18:21:39 -0700 Message-Id: <200112170121.fBH1Ldp32763@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v199.5 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 199.5 of my devfs patch is now available from: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html The devfs FAQ is also available here. Patch directly available from: ftp://ftp.??.kernel.org/pub/linux/kernel/people/rgooch/v2.4/devfs-patch-current.gz AND: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/kernel-patches/v2.4/devfs-patch-current.gz NOTE: this is the patch that I'll be sending to Marcelo soon. PLEASE TEST this patch if you use devfs, otherwise don't complain if there are lingering problems. This patch should fix all known remaining problems, including the devfs/blkdev races that Al Viro has mentioned. This is against 2.4.17-rc1. Highlights of this release: - Added clarifying comments in response to preliminary EMC code review (missed in ChangeLog in devfs-patch-v199.4) - Added poisoning to - Improved debugging messages - Fixed unregister bugs in drivers/md/lvm-fs.c Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Sun Dec 16 19:28:28 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBH3SSs05447 for devfs-outgoing; Sun, 16 Dec 2001 19:28:28 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBH3SNo05443 for ; Sun, 16 Dec 2001 19:28:23 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fBH2RvG01603; Sun, 16 Dec 2001 19:27:57 -0700 Date: Sun, 16 Dec 2001 19:27:57 -0700 Message-Id: <200112170227.fBH2RvG01603@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v204 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 204 of my devfs patch is now available from: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html The devfs FAQ is also available here. Patch directly available from: ftp://ftp.??.kernel.org/pub/linux/kernel/people/rgooch/v2.5/devfs-patch-current.gz AND: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/kernel-patches/v2.5/devfs-patch-current.gz NOTE: kernel 2.5.1 and later require devfsd-v1.3.19 or later. This is against 2.5.1. Highlights of this release: - Removed long obsolete rc.devfs - Return old entry in for 2.4.x kernels - Updated README from master HTML file - Increment refcount on module in - Created and exported - Increment refcount on module in - Created and used where needed to fix races - Added clarifying comments in response to preliminary EMC code review - Added poisoning to - Improved debugging messages - Fixed unregister bugs in drivers/md/lvm-fs.c Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Tue Dec 18 17:23:50 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBJ1Now25116 for devfs-outgoing; Tue, 18 Dec 2001 17:23:50 -0800 Received: from mail.labsysgrp.com (PHNX1-UBR2-4-hfc-0251-d1dae065.rdc1.az.coxatwork.com [209.218.224.101] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBJ1Nho25112 for ; Tue, 18 Dec 2001 17:23:44 -0800 Received: from mail by mail.labsysgrp.com with scanned-ok (Exim 3.33 #1) id 16GUWG-0001X4-00 for devfs@oss.sgi.com; Tue, 18 Dec 2001 17:23:36 -0700 Received: from jeeves.kpf.internal ([192.168.170.1]) by mail.labsysgrp.com with esmtp (Exim 3.33 #1) id 16GUWB-0001WK-00; Tue, 18 Dec 2001 17:23:34 -0700 Received: from [192.168.170.108] (helo=kevin) by jeeves.kpf.internal with smtp (Exim 3.30 #1) id 16GQgK-0000qc-00; Tue, 18 Dec 2001 13:17:44 -0700 Message-ID: <000c01c18801$24153900$6caaa8c0@kevin> From: "Kevin P. Fleming" To: "Richard Gooch" Cc: "Paul Bristow" , , 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><3C0FED36.9050506@paulbristow.net><010b01c17f4f$87b478a0$c8aaa8c0@kevin><200112090303.fB933vw04632@vindaloo.ras.ucalgary.ca><001501c181ba$fdb65650$6caaa8c0@kevin><200112140650.fBE6oN201769@vindaloo.ras.ucalgary.ca><003401c184bc$107efb80$6caaa8c0@kevin><200112141810.fBEIA6k05971@vindaloo.ras.ucalgary.ca><000b01c1858e$acd2c930$6caaa8c0@kevin> <200112151756.fBFHuCH15168@vindaloo.ras.ucalgary.ca> Subject: Re: Removeable Media, partitions and devfs? Date: Tue, 18 Dec 2001 13:18:22 -0700 Organization: LSG, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-devfs@oss.sgi.com Precedence: bulk > > > --- check.c~ Thu Oct 11 18:25:10 2001 > > > +++ check.c Fri Dec 14 11:02:19 2001 > > > @@ -338,7 +338,8 @@ > > > if (!unregister) > > > devfs_register_disc (dev, minor); > > > for (part = 1; part < dev->max_p; part++) { > > > - if ( unregister || (dev->part[part + minor].nr_sects < 1) ) { > > > + if ( unregister || (dev->part[minor].nr_sects < 1) || > > > + (dev->part[part + minor].nr_sects < 1) ) { > > > devfs_unregister (dev->part[part + minor].de); > > > dev->part[part + minor].de = NULL; > > > continue; > > > @@ -383,6 +384,8 @@ > > > > > > dev->part[first_minor].nr_sects = size; > > > /* No such device or no minors to use for partitions */ > > > + if ( !size && dev->flags && (dev->flags[drive] & GENHD_FL_REMOVABLE) ) > > > + devfs_register_partitions (dev, first_minor, 0); > > > if (!size || minors == 1) > > > return; > > > > Sorry, this code never gets called... grok_partitions doesn't call > > check_partition when "size" is zero, and check_partition is the only > > function that calls devfs_register_partitions, which is where this > > change was made. Want to make another attempt? :-) > > ?!?!?!? My patch has two hunks. One which modifies > devfs_register_partitions(), and another which modifies > grok_partitions() to call devfs_register_partitions() when size==0 for > removable media devices. This should work. > > Did you actually try this? > > Regards, > > Richard.... > Permanent: rgooch@atnf.csiro.au > Current: rgooch@ras.ucalgary.ca > > Sorry for the delay in responding, but the good news is that this patch does cause things to work as expected. The partition entries appear and disappear as they should. Richard, I assume you'll incorporate this into your next devfs patch release? I've already sent Marcelo the small patch for ide-probe.c, he's queued it for 2.4.18-pre1. Paul, I know you've been on the sidelines lurking here... once these changes are in, all that will be left is the changes to ide-floppy, which are fairly large (diff size-wise), but not too difficult to understand. Can you accept a single diff with all the changes I've made, or do you need them broken apart? The changes include: - cosmetic fix to keep ide-floppy from printk'ing its version string more than once - implemented media change detection - changed many functions to not allocate idefloppy_pc_t on the stack (it's much too large), but instead to kmalloc/kfree it From owner-devfs@oss.sgi.com Tue Dec 18 23:57:23 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBJ7vNj03134 for devfs-outgoing; Tue, 18 Dec 2001 23:57:23 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBJ7vIo03131 for ; Tue, 18 Dec 2001 23:57:18 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fBJ6v6d04728; Tue, 18 Dec 2001 23:57:06 -0700 Date: Tue, 18 Dec 2001 23:57:06 -0700 Message-Id: <200112190657.fBJ6v6d04728@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: "Kevin P. Fleming" Cc: "Paul Bristow" , , Subject: Re: Removeable Media, partitions and devfs? In-Reply-To: <000c01c18801$24153900$6caaa8c0@kevin> 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> <3C0FED36.9050506@paulbristow.net> <010b01c17f4f$87b478a0$c8aaa8c0@kevin> <200112090303.fB933vw04632@vindaloo.ras.ucalgary.ca> <001501c181ba$fdb65650$6caaa8c0@kevin> <200112140650.fBE6oN201769@vindaloo.ras.ucalgary.ca> <003401c184bc$107efb80$6caaa8c0@kevin> <200112141810.fBEIA6k05971@vindaloo.ras.ucalgary.ca> <000b01c1858e$acd2c930$6caaa8c0@kevin> <200112151756.fBFHuCH15168@vindaloo.ras.ucalgary.ca> <000c01c18801$24153900$6caaa8c0@kevin> Sender: owner-devfs@oss.sgi.com Precedence: bulk Kevin P. Fleming writes: > > ?!?!?!? My patch has two hunks. One which modifies > > devfs_register_partitions(), and another which modifies > > grok_partitions() to call devfs_register_partitions() when size==0 for > > removable media devices. This should work. > > > > Did you actually try this? > > Sorry for the delay in responding, but the good news is that this > patch does cause things to work as expected. The partition entries > appear and disappear as they should. Great! > Richard, I assume you'll incorporate this into your next devfs patch > release? I've already sent Marcelo the small patch for ide-probe.c, > he's queued it for 2.4.18-pre1. No, I didn't want to incorporate it into a patch I sent of to Marcelo until I was sure it worked. And Marcelo has already put out 2.4.17-rc2. I'll send it off to Marcelo, but I suspect he will queue it for 2.4.18-pre1 rather than 2.4.17-rc3, since it's not a critical bugfix. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Dec 20 08:45:21 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBKGjLS11287 for devfs-outgoing; Thu, 20 Dec 2001 08:45:21 -0800 Received: from xandros.com (209-87-236-21.ottawa.storm.ca [209.87.236.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBKGjFX11284 for ; Thu, 20 Dec 2001 08:45:15 -0800 Received: (qmail 6403 invoked by uid 2); 20 Dec 2001 15:45:07 -0000 Received: from madmax.xandros.com (HELO hawk.ottawa.xandros.ca) (209.87.236.30) by plan9.xandros.com with DES-CBC3-SHA encrypted SMTP; 20 Dec 2001 15:45:07 -0000 Date: Thu, 20 Dec 2001 10:45:07 -0500 (EST) From: "Hong H. Pham" X-X-Sender: hhp@hawk.ottawa.xandros.ca To: devfs@oss.sgi.com Subject: Adding/deleting partitions does not notify DevFS Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, The functions add_partition() and del_partition(), for the ioctl() commands BLKPG_ADD_PARTITION and BLKPG_DEL_PARTITION respectively, in drivers/block/blkpg.c do not notify the devfs system that the partition layout has been changed. Consequently, the desired symlinks in /dev/discs/... disappear and the entries in /proc/partitions are invalid. I am using the 2.4.16 kernel. This problem can be verified by using GNU libparted (1.5.x) on a system running DevFS. Use the command 'parted' to add or delete a partition (but at least one partition should exist), and commit to disk. Cheers, ..Hong From owner-devfs@oss.sgi.com Thu Dec 20 09:39:30 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBKHdU213494 for devfs-outgoing; Thu, 20 Dec 2001 09:39:30 -0800 Received: from mail.labsysgrp.com (PHNX1-UBR2-4-hfc-0251-d1dae065.rdc1.az.coxatwork.com [209.218.224.101] (may be forged)) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBKHdMX13491 for ; Thu, 20 Dec 2001 09:39:25 -0800 Received: from mail by mail.labsysgrp.com with scanned-ok (Exim 3.34 #1) id 16H6Dy-000332-00 for devfs@oss.sgi.com; Thu, 20 Dec 2001 09:39:14 -0700 Received: from jeeves.kpf.internal ([192.168.170.1]) by mail.labsysgrp.com with esmtp (Exim 3.34 #1) id 16H6Dv-00032j-00; Thu, 20 Dec 2001 09:39:12 -0700 Received: from [192.168.170.108] (helo=kevin) by jeeves.kpf.internal with smtp (Exim 3.30 #1) id 16H6DK-0003ZH-00; Thu, 20 Dec 2001 09:38:34 -0700 Message-ID: <012801c18974$de208790$6caaa8c0@kevin> From: "Kevin P. Fleming" To: "Hong H. Pham" , References: Subject: Re: Adding/deleting partitions does not notify DevFS Date: Thu, 20 Dec 2001 09:39:17 -0700 Organization: LSG, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS snapshot-20010714 Sender: owner-devfs@oss.sgi.com Precedence: bulk Then this is a bug in the block device driver... the driver should cause a revalidate after those ioctls are issued (and succeed). When the revalidate is done, the devfs partition entries will be kept in sync with the device's partition list. Normally, the partition editor itself (fdisk, parted, etc.) will cause the revalidate as well when you save the table to the device. Is there some reason why this is not happening with the blkpg driver? ----- Original Message ----- From: "Hong H. Pham" To: Sent: Thursday, December 20, 2001 8:45 AM Subject: Adding/deleting partitions does not notify DevFS > Hi, > > The functions add_partition() and del_partition(), for the ioctl() > commands BLKPG_ADD_PARTITION and BLKPG_DEL_PARTITION respectively, in > drivers/block/blkpg.c do not notify the devfs system that the > partition layout has been changed. Consequently, the desired symlinks > in /dev/discs/... disappear and the entries in /proc/partitions are > invalid. > > I am using the 2.4.16 kernel. This problem can be verified by using GNU > libparted (1.5.x) on a system running DevFS. Use the command 'parted' to > add or delete a partition (but at least one partition should exist), and > commit to disk. > > Cheers, > ..Hong > > > > From owner-devfs@oss.sgi.com Thu Dec 20 14:58:24 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBKMwOS25226 for devfs-outgoing; Thu, 20 Dec 2001 14:58:24 -0800 Received: from david.siemens.de (david.siemens.de [192.35.17.14]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBKMwJX25222 for ; Thu, 20 Dec 2001 14:58:19 -0800 Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by david.siemens.de (8.11.6/8.11.6) with ESMTP id fBKLwGS26231 for ; Thu, 20 Dec 2001 22:58:16 +0100 (MET) Received: from MOWD019A.mow.siemens.ru ([139.24.18.3]) by mail3.siemens.de (8.11.6/8.11.6) with ESMTP id fBKLvpH22036 for ; Thu, 20 Dec 2001 22:57:51 +0100 (MET) Received: by mowd019a.mow.siemens.ru with Internet Mail Service (5.5.2653.19) id ; Fri, 21 Dec 2001 01:00:04 +0300 Received: from [149.202.201.201] (149.202.201.201 [149.202.201.201]) by MOWD019A.mow.siemens.ru with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id ZJK1X9R5; Fri, 21 Dec 2001 01:00:02 +0300 From: Borsenkow Andrej To: Thierry Vignaud Cc: devfs mailing list Subject: modules.devfsd needs /dev/scsi/*/part* handling Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/1.0 (Preview Release) Date: 21 Dec 2001 00:58:05 +0300 Message-Id: <1008885491.6464.4.camel@localhost.localdomain> Mime-Version: 1.0 Sender: owner-devfs@oss.sgi.com Precedence: bulk I was just surprised why my Jaz on parallel port (ppa adapter) never appears. It turned out, after desperate fight with symlinks I finally changed fstab to point to canonical name - /dev/scsi/host0/bus0/target4/lun0/part4. But these names are not handled by modules.devfs so sd_mod was never loaded. There is handling for /dev/sd/* (that I had before). But it is just a symlink and after eject it gets lost and when you try to access it again sd_mod is already loaded so nothing happens (i.e. new media is not rescanned for partition info). There is handling for /dev/discs - but, unfortunately, there is no fixed relation between physical address (host/bus/target) and disc number - they are simply numbered after they get registered so if you have several removables sometimes they get one number sometimes other. And I want to be sure I always refer to correct drive. The imediate quick'n'dirty fix was to add alias /dev/scsi*/part* /dev/sd to /etc/modules.devfs Still, it looks like a part of more general problem. I begin to think that devfsd has to treat LOOKUP for symlinks that are managed by devfsd itdelf specially. I.e. when it gets request for /dev/sd/c0b0t4l0u4 it _knows_ that it points to /dev/scsi/..../part4 so it _could_ translate it into request to that canonical name so that devfs would start partition table revalidation. Does it make sense? -andrej From owner-devfs@oss.sgi.com Thu Dec 20 17:13:00 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBL1D0k27558 for devfs-outgoing; Thu, 20 Dec 2001 17:13:00 -0800 Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBL1CsX27555 for ; Thu, 20 Dec 2001 17:12:54 -0800 Received: from proski by fencepost.gnu.org with local (Exim 3.22 #1 (Debian)) id 16HDIx-0002gr-00 for ; Thu, 20 Dec 2001 19:12:51 -0500 Date: Thu, 20 Dec 2001 19:12:49 -0500 (EST) From: Pavel Roskin X-X-Sender: proski@marabou.research.att.com To: devfs@oss.sgi.com Subject: [PATCH] Use mksymlink in the sample devfsd.conf Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-devfs@oss.sgi.com Precedence: bulk Hello! The file devfsd.conf included with devfsd-1.3.19 used symlink() whereas the manual recommends using mksymlink(). Here's the patch: ========================= --- devfsd.conf +++ devfsd.conf @@ -38,6 +38,6 @@ # Uncomment this if you want the old /dev/cdrom symlink # (e.g. those specifying CD-ROM type, mouse port, modem port etc) # -#LOOKUP ^cdrom$ CFUNCTION GLOBAL symlink cdroms/cdrom0 $devpath -#REGISTER ^cdrom/cdrom0$ CFUNCTION GLOBAL symlink cdroms/cdrom0 cdrom +#LOOKUP ^cdrom$ CFUNCTION GLOBAL mksymlink cdroms/cdrom0 $devpath +#REGISTER ^cdrom/cdrom0$ CFUNCTION GLOBAL mksymlink cdroms/cdrom0 cdrom #UNREGISTER ^cdrom/cdrom0$ CFUNCTION GLOBAL unlink cdrom ========================= By the way, CFUNCTION doesn't work if devfsd is statically linked. This may be a serious limitation for some embedded configurations. I also can imagine that some sysadmins would want to link some basic utilities statically to survive possible libc problems. What if we implement mksymlink and unlink as separate actions, like COPY? These are very basic operations that most people need. -- Regards, Pavel Roskin From owner-devfs@oss.sgi.com Thu Dec 20 17:18:55 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBL1ItY27699 for devfs-outgoing; Thu, 20 Dec 2001 17:18:55 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBL1IpX27696 for ; Thu, 20 Dec 2001 17:18:51 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fBL0Il206835; Thu, 20 Dec 2001 17:18:47 -0700 Date: Thu, 20 Dec 2001 17:18:47 -0700 Message-Id: <200112210018.fBL0Il206835@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Pavel Roskin Cc: devfs@oss.sgi.com Subject: Re: [PATCH] Use mksymlink in the sample devfsd.conf In-Reply-To: References: Sender: owner-devfs@oss.sgi.com Precedence: bulk Pavel Roskin writes: > Hello! > > The file devfsd.conf included with devfsd-1.3.19 used symlink() whereas > the manual recommends using mksymlink(). Here's the patch: > > ========================= > --- devfsd.conf > +++ devfsd.conf > @@ -38,6 +38,6 @@ > # Uncomment this if you want the old /dev/cdrom symlink > # (e.g. those specifying CD-ROM type, mouse port, modem port etc) > # > -#LOOKUP ^cdrom$ CFUNCTION GLOBAL symlink cdroms/cdrom0 $devpath > -#REGISTER ^cdrom/cdrom0$ CFUNCTION GLOBAL symlink cdroms/cdrom0 cdrom > +#LOOKUP ^cdrom$ CFUNCTION GLOBAL mksymlink cdroms/cdrom0 $devpath > +#REGISTER ^cdrom/cdrom0$ CFUNCTION GLOBAL mksymlink cdroms/cdrom0 cdrom > #UNREGISTER ^cdrom/cdrom0$ CFUNCTION GLOBAL unlink cdrom > ========================= Already fixed this in devfsd-v1.3.20 (released 20-NOV). > By the way, CFUNCTION doesn't work if devfsd is statically linked. This > may be a serious limitation for some embedded configurations. I also can > imagine that some sysadmins would want to link some basic utilities > statically to survive possible libc problems. > > What if we implement mksymlink and unlink as separate actions, like COPY? > These are very basic operations that most people need. I'm reluctant to do this, as it adds more code to devfsd. And the main reason I want to keep devfsd small is for embedded systems. I think an embedded system is better off including a shared C library. It will save space overall (at least if you use a decent, lightweight C library). Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Dec 20 17:28:57 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBL1Svt28145 for devfs-outgoing; Thu, 20 Dec 2001 17:28:57 -0800 Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBL1SsX28142 for ; Thu, 20 Dec 2001 17:28:54 -0800 Received: from proski by fencepost.gnu.org with local (Exim 3.22 #1 (Debian)) id 16HDYI-0004QE-00; Thu, 20 Dec 2001 19:28:42 -0500 Date: Thu, 20 Dec 2001 19:28:40 -0500 (EST) From: Pavel Roskin X-X-Sender: proski@marabou.research.att.com To: Richard Gooch cc: devfs@oss.sgi.com Subject: Re: [PATCH] Use mksymlink in the sample devfsd.conf In-Reply-To: <200112210018.fBL0Il206835@vindaloo.ras.ucalgary.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, Richard! > > The file devfsd.conf included with devfsd-1.3.19 used symlink() whereas > > the manual recommends using mksymlink(). Here's the patch: > > Already fixed this in devfsd-v1.3.20 (released 20-NOV). Sorry, I missed that release. > I'm reluctant to do this, as it adds more code to devfsd. And the main > reason I want to keep devfsd small is for embedded systems. I think an > embedded system is better off including a shared C library. It will > save space overall (at least if you use a decent, lightweight C > library). Ok. -- Regards, Pavel Roskin From owner-devfs@oss.sgi.com Wed Dec 26 14:16:31 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBQMGVj27283 for devfs-outgoing; Wed, 26 Dec 2001 14:16:31 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBQMGRX27280 for ; Wed, 26 Dec 2001 14:16:27 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fBQLGJY22088; Wed, 26 Dec 2001 14:16:19 -0700 Date: Wed, 26 Dec 2001 14:16:19 -0700 Message-Id: <200112262116.fBQLGJY22088@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v199.6 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 199.6 of my devfs patch is now available from: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html The devfs FAQ is also available here. Patch directly available from: ftp://ftp.??.kernel.org/pub/linux/kernel/people/rgooch/v2.4/devfs-patch-current.gz AND: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/kernel-patches/v2.4/devfs-patch-current.gz This is against 2.4.17. Highlights of this release: - Corrected (made useful) debugging message in - Moved in to - Fixed drivers/md/lvm-fs.c to create "lvm" entry - Added magic number to guard against scribbling drivers - Only return old entry in if a directory - Defined macros for error and debug messages - Updated README from master HTML file Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Wed Dec 26 19:47:24 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBR3lOH01674 for devfs-outgoing; Wed, 26 Dec 2001 19:47:24 -0800 Received: from vindaloo.ras.ucalgary.ca (vindaloo.ras.ucalgary.ca [136.159.55.21]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBR3lGX01669 for ; Wed, 26 Dec 2001 19:47:16 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fBR2lJF26074; Wed, 26 Dec 2001 19:47:19 -0700 Date: Wed, 26 Dec 2001 19:47:19 -0700 Message-Id: <200112270247.fBR2lJF26074@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v205 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 205 of my devfs patch is now available from: http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html The devfs FAQ is also available here. Patch directly available from: ftp://ftp.??.kernel.org/pub/linux/kernel/people/rgooch/v2.5/devfs-patch-current.gz AND: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/kernel-patches/v2.5/devfs-patch-current.gz NOTE: kernel 2.5.1 and later require devfsd-v1.3.19 or later. This is against 2.5.2-pre2. Highlights of this release: - Corrected (made useful) debugging message in - Moved in to - Fixed drivers/md/lvm-fs.c to create "lvm" entry - Added magic number to guard against scribbling drivers - Only return old entry in if a directory - Defined macros for error and debug messages - Updated README from master HTML file Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Mon Dec 31 14:44:30 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fBVMiU810048 for devfs-outgoing; Mon, 31 Dec 2001 14:44:30 -0800 Received: from VL-MS-MR003.sc1.videotron.ca (relais.videotron.ca [24.201.245.36]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fBVMiOg10045 for ; Mon, 31 Dec 2001 14:44:24 -0800 Received: from cthulhu.gerg.ca ([24.201.231.94]) by VL-MS-MR003.sc1.videotron.ca (Netscape Messaging Server 4.15 MR003 Jul 24 2001 16:23:26) with ESMTP id GP89PW00.LJK for ; Mon, 31 Dec 2001 16:44:20 -0500 Received: from greg by cthulhu.gerg.ca with local (Exim 3.33 #1 (Debian)) id 16LAEG-0001bX-00 for ; Mon, 31 Dec 2001 16:44:20 -0500 Date: Mon, 31 Dec 2001 16:44:20 -0500 From: Greg Ward To: devfs@oss.sgi.com Subject: Doc error in Debian devfsd.conf(5)? Message-ID: <20011231214420.GA6138@gerg.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.3.24i Sender: owner-devfs@oss.sgi.com Precedence: bulk Sometime in the last month or two, the syntax of regular expressions in devfsd as packaged in Debian woody has changed. It appears that escaping parentheses for their "special" regex-ish meaning is no longer necessary, ie. a bare paren is the same as in Perl or awk. I assume this change was deliberate and intentional; I certainly think it's the better syntax. However, the docs are lagging. devfsd.conf(5) has this example: LOOKUP ^\(\(ide\|scsi\)/host[0-9]\+/bus[0-9]\+/target[0-9]\+/lun[0-9]\+\)/part[0-9]\+$ EXECUTE /sbin/partx -a $mntpnt/\1/disc and the accompanying text says: Notice the use of regular expression substituation in the command "\1", corresponding to the first set of parentheses in the regu­ lar expression being matched (yes, the backslashes are syntactically necesary for the special meaning of the parentheses, the vertical bar and the plus sign). I assume this is just a doc bug, and that either Russell or Richard will see this and fix it (if they haven't already). Oh, this is with devfsd 1.3.18-13, the latest in Debian "woody" right now. Greg -- Greg Ward - Linux nerd gward@python.net http://starship.python.net/~gward/ A day without sunshine is like night.