From owner-devfs@oss.sgi.com Sat Nov 3 01:02:36 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fA392aU29883 for devfs-outgoing; Sat, 3 Nov 2001 01:02:36 -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 fA392K029871 for ; Sat, 3 Nov 2001 01:02:20 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fA391li16209; Sat, 3 Nov 2001 02:01:47 -0700 Date: Sat, 3 Nov 2001 02:01:47 -0700 Message-Id: <200111030901.fA391li16209@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: =?iso-8859-1?Q?Per_Lid=E9n?= Cc: Subject: Re: Problems with devfs v.117 (patch) In-Reply-To: References: Sender: owner-devfs@oss.sgi.com Precedence: bulk per@fukt.bth.se writes: > I've been having problems with devfs since kernel 2.4.11 (ie. devfs > version 117). The problem (which I can easily reproduce) occurs if I > start X and then start a number of xterms. Then /dev becomes > unreadable and all xterms hangs. Any further access to /dev by any > program will produce an unkillable process. E.g. "ls /dev" will hang > and if I switch to another vc and do "kill -9" on the ls process > nothing happens. And as a result, I can't even do a clean shutdown > since init, umount, etc all access /dev. Please try the appended patch and let me know if it fixes the problem. If not, please re-submit your bug report in full. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca diff -urN linux-2.4.14-pre7/Documentation/filesystems/devfs/ChangeLog linux/Documentation/filesystems/devfs/ChangeLog --- linux-2.4.14-pre7/Documentation/filesystems/devfs/ChangeLog Thu Oct 11 00:23:24 2001 +++ linux/Documentation/filesystems/devfs/ChangeLog Sat Nov 3 01:29:39 2001 @@ -1771,3 +1771,10 @@ - Fixed buffer underrun in - Moved down_read() from to +=============================================================================== +Changes for patch v196 + +- Fixed race in when setting event mask + Thanks to Kari Hurtta + +- Avoid deadlock in by using temporary buffer diff -urN linux-2.4.14-pre7/fs/devfs/base.c linux/fs/devfs/base.c --- linux-2.4.14-pre7/fs/devfs/base.c Thu Oct 11 00:23:24 2001 +++ linux/fs/devfs/base.c Sat Nov 3 01:40:10 2001 @@ -555,6 +555,11 @@ Fixed buffer underrun in . Moved down_read() from to v0.119 + 20011029 Richard Gooch + Fixed race in when setting event mask. + 20011103 Richard Gooch + Avoid deadlock in by using temporary buffer. + v0.120 */ #include #include @@ -587,7 +592,7 @@ #include #include -#define DEVFS_VERSION "0.119 (20011009)" +#define DEVFS_VERSION "0.120 (20011103)" #define DEVFS_NAME "devfs" @@ -3029,13 +3034,25 @@ { int err; struct devfs_entry *de; + char *copy; de = get_devfs_entry_from_vfs_inode (dentry->d_inode, TRUE); if (!de) return -ENODEV; down_read (&symlink_rwsem); - err = de->registered ? vfs_follow_link (nd, - de->u.symlink.linkname) : -ENODEV; + if (!de->registered) + { + up_read (&symlink_rwsem); + return -ENODEV; + } + copy = kmalloc (de->u.symlink.length + 1, GFP_KERNEL); + if (copy) memcpy (copy, de->u.symlink.linkname, de->u.symlink.length + 1); up_read (&symlink_rwsem); + if (copy) + { + err = vfs_follow_link (nd, copy); + kfree (copy); + } + else err = -ENOMEM; return err; } /* End Function devfs_follow_link */ @@ -3212,7 +3229,6 @@ { int ival; struct fs_info *fs_info = inode->i_sb->u.generic_sbp; - static spinlock_t lock = SPIN_LOCK_UNLOCKED; switch (cmd) { @@ -3226,7 +3242,14 @@ doesn't matter who gets in first, as long as only one gets it */ if (fs_info->devfsd_task == NULL) { + static spinlock_t lock = SPIN_LOCK_UNLOCKED; + if ( !spin_trylock (&lock) ) return -EBUSY; + if (fs_info->devfsd_task != NULL) + { /* We lost the race... */ + spin_unlock (&lock); + return -EBUSY; + } fs_info->devfsd_task = current; spin_unlock (&lock); fs_info->devfsd_file = file; From owner-devfs@oss.sgi.com Sat Nov 3 09:47:25 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fA3HlPx04139 for devfs-outgoing; Sat, 3 Nov 2001 09:47: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 fA3HlK004135 for ; Sat, 3 Nov 2001 09:47:20 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fA3Hl0u19223; Sat, 3 Nov 2001 10:47:00 -0700 Date: Sat, 3 Nov 2001 10:47:00 -0700 Message-Id: <200111031747.fA3Hl0u19223@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v196 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 196 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.14-pre7. Highlights of this release: - Fixed race in when setting event mask Thanks to Kari Hurtta - Avoid deadlock in by using temporary buffer Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Tue Nov 6 22:19:06 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fA76J6x32451 for devfs-outgoing; Tue, 6 Nov 2001 22:19: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 fA76J1032448 for ; Tue, 6 Nov 2001 22:19:01 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fA76IgB03902; Tue, 6 Nov 2001 23:18:42 -0700 Date: Tue, 6 Nov 2001 23:18:42 -0700 Message-Id: <200111070618.fA76IgB03902@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Russell Coker Cc: devfs@oss.sgi.com Subject: Re: patch for annoying symlink warnings In-Reply-To: <20011024202208.1288A3836C2@lyta.coker.com.au> References: <20011024202208.1288A3836C2@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk Russell Coker writes: > error calling: "symlink" in "GLOBAL" > error calling: "symlink" in "GLOBAL" > error calling: "symlink" in "GLOBAL" > > When you do "killall -1 devfsd" to reload the config you often see errors > such as the above. These are because of "CFUNCTION GLOBAL symlink" events > trying to create the link a second time. > > I have attached a patch that fixes this issue. It has special case > code for "GLOBAL symlink" which calls an internal function instead > of the libc function (to preserve config file compatibility). This > function does the usual symlink operation but gives no error message > when the link as desired is already there (if you ask for "symlink > $devname modem" and there is already a symlink /dev/modem pointing > at /dev/$devname then it's not an error IMHO). When there is a real > error it gives slightly more information. > > Richard, please consider this for inclusion in the main tree. Sorry, but I hate it. The worst offence is to put special-case hacks into the parser. That's just too ugly for words. I'm also uneasy about wrapping C-library functions. My preferred solution to this (something I've been thinking about for a while because it's generally useful) is to allow options to be specified for actions. So you would have something like this: REGISTER ^cdrom/cdrom0$ CFUNCTION,nowarn GLOBAL symlink cdroms/cdrom0 cdrom Comments? Yes, I know it requires a config file change, but tough. Even if I were to allow a symlink wrapper, I'd still force a config file change. Magic re-interpretation of libc is not an option. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Tue Nov 6 22:37:57 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fA76bv700349 for devfs-outgoing; Tue, 6 Nov 2001 22:37:57 -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 fA76br000343 for ; Tue, 6 Nov 2001 22:37:53 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fA76bcc04402; Tue, 6 Nov 2001 23:37:38 -0700 Date: Tue, 6 Nov 2001 23:37:38 -0700 Message-Id: <200111070637.fA76bcc04402@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Russell Coker Cc: devfs@oss.sgi.com Subject: Re: setsid() and new sysvinit In-Reply-To: <20011023110639.505AE8E6@lyta.coker.com.au> References: <20011023110639.505AE8E6@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk Russell Coker writes: > Firstly I just noticed that devfsd is not calling setsid() after doing > close(0);close(1);close(2); is there a good reason for this or is it an > oversight? It is my understanding that all daemons should call setsid()... > > I came across this while investigating a problem that occurs with the latest > sysvinit package in Debian. Sysvinit now makes /dev/console the controlling > terminal for daemons started before multi-user mode is initiated. This means > that it will be sent a SIGHUP by the kernel when the session ends (IE > multi-user mode is started). > > The SIGHUP results in the configuration reload which displays annoying error > messages to the console. > > With the current way devfsd works the console is kept open until /dev/log is > created, at which time openlog() is called and the stdin/stdout/stderr are > closed. > > But the session is ended before syslogd is started. > > What can we do about this? Would it be a good idea to do > close(0);close(1);close(2); at the start of the program and then > open("/dev/console", O_WRONLY|O_NOCTTY); ? > > Of course if you want to start devfsd on some other device and have > all the error messages go there before syslogd is started and not > have the messages go there then this won't be what you want. Why not just call setsid(2) after closing fds[0:2]? I've just added that to me tree. That avoids the problem you describe above with having the output go elsewhere and then being redirected to /dev/console. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Tue Nov 6 22:51:45 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fA76pjf00528 for devfs-outgoing; Tue, 6 Nov 2001 22:51:45 -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 fA76pf000525 for ; Tue, 6 Nov 2001 22:51:41 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fA76pWD04565; Tue, 6 Nov 2001 23:51:32 -0700 Date: Tue, 6 Nov 2001 23:51:32 -0700 Message-Id: <200111070651.fA76pWD04565@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: C R Johnson Cc: devfs Subject: Re: devfs newbie: dissapearing or somtimes not created cdrom In-Reply-To: <3BB4BA32.3070704@freeengineer.org> References: <3BB4BA32.3070704@freeengineer.org> Sender: owner-devfs@oss.sgi.com Precedence: bulk C. R. Johnson writes: > Rob MacGregor wrote: > > > > > I suspect you'll find that the cdrom drive support is compiled as a > > module. When the module hasn't been used for some time it'll be > > removed and devfs will unregister it. That's what happened to me with > > my printer and tape drive. However reloading the modules solved this. > > > Reloading the modules does not work for me. > > Here are some things I noticed, > > - from /var/log/messages when devfsd unloaded: > > Sep 27 23:50:00 pigpen devfsd[19]: action_compat: error unlinking: > "cdrom0"^INsuch file or directory > > It really looks like that, "^I and all". > > - unloading and reloading the cdrom driver changes nothing: I don't know what's wrong. Perhaps it's fixed in the 2.4.14 already. If not, wait for the 1.0 version of the new devfs core to be released. I'd rather not chase bugs in the old code, since I want to concentrate on getting the new code working. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Tue Nov 6 23:26:39 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fA77Qdw01327 for devfs-outgoing; Tue, 6 Nov 2001 23:26:39 -0800 Received: from tsv.sws.net.au (tsv.sws.net.au [203.36.46.2]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fA77QX001324 for ; Tue, 6 Nov 2001 23:26:33 -0800 Received: from lyta.coker.com.au (localhost [127.0.0.1]) by tsv.sws.net.au (Postfix) with ESMTP id A247E92652; Wed, 7 Nov 2001 18:25:43 +1100 (EST) Received: from there (lyta [127.0.0.1]) by lyta.coker.com.au (Postfix) with SMTP id F2AB95D59; Wed, 7 Nov 2001 08:23:58 +0100 (CET) Content-Type: text/plain; charset="iso-8859-1" From: Russell Coker Reply-To: Russell Coker To: Richard Gooch Subject: Re: patch for annoying symlink warnings Date: Wed, 7 Nov 2001 08:23:58 +0100 X-Mailer: KMail [version 1.3.2] Cc: devfs@oss.sgi.com References: <20011024202208.1288A3836C2@lyta.coker.com.au> <200111070618.fA76IgB03902@vindaloo.ras.ucalgary.ca> In-Reply-To: <200111070618.fA76IgB03902@vindaloo.ras.ucalgary.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20011107072359.F2AB95D59@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk On Wed, 7 Nov 2001 07:18, Richard Gooch wrote: > > error calling: "symlink" in "GLOBAL" > > error calling: "symlink" in "GLOBAL" > > error calling: "symlink" in "GLOBAL" > > > > When you do "killall -1 devfsd" to reload the config you often see errors > > such as the above. These are because of "CFUNCTION GLOBAL symlink" > > events trying to create the link a second time. > > > > I have attached a patch that fixes this issue. It has special case > > code for "GLOBAL symlink" which calls an internal function instead > > of the libc function (to preserve config file compatibility). This > > function does the usual symlink operation but gives no error message > > when the link as desired is already there (if you ask for "symlink > > $devname modem" and there is already a symlink /dev/modem pointing > > at /dev/$devname then it's not an error IMHO). When there is a real > > error it gives slightly more information. > > > > Richard, please consider this for inclusion in the main tree. > > Sorry, but I hate it. The worst offence is to put special-case hacks > into the parser. That's just too ugly for words. I'm also uneasy about > wrapping C-library functions. I was half expecting that response. > My preferred solution to this (something I've been thinking about > for a while because it's generally useful) is to allow options to be > specified for actions. So you would have something like this: > REGISTER ^cdrom/cdrom0$ CFUNCTION,nowarn GLOBAL symlink cdroms/cdrom0 > cdrom So we don't warn if the user tries to create a symlink in a non-existant directory, try to replace a device node with a symlink, or do any of the other possible errors? If we're going to change the config file then why not make it: REGISTER ^cdrom/cdrom0$ CFUNCTION GLOBAL devsymlink cdroms/cdrom0 cdrom Then we have a devsymlink() function internal to devfsd which does something similar to what I've proposed. > Comments? Yes, I know it requires a config file change, but tough. > Even if I were to allow a symlink wrapper, I'd still force a config > file change. Magic re-interpretation of libc is not an option. OK. But I'll leave the magic re-interpretation in the Debian package until we come up with something better... -- http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/projects.html Projects I am working on http://www.coker.com.au/~russell/ My home page From owner-devfs@oss.sgi.com Wed Nov 7 00:07:50 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fA787oi02032 for devfs-outgoing; Wed, 7 Nov 2001 00:07:50 -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 fA787i002029 for ; Wed, 7 Nov 2001 00:07:44 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fA787OO05414; Wed, 7 Nov 2001 01:07:24 -0700 Date: Wed, 7 Nov 2001 01:07:24 -0700 Message-Id: <200111070807.fA787OO05414@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Russell Coker Cc: devfs@oss.sgi.com Subject: Re: patch for annoying symlink warnings In-Reply-To: <20011107072359.F2AB95D59@lyta.coker.com.au> References: <20011024202208.1288A3836C2@lyta.coker.com.au> <200111070618.fA76IgB03902@vindaloo.ras.ucalgary.ca> <20011107072359.F2AB95D59@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk Russell Coker writes: > On Wed, 7 Nov 2001 07:18, Richard Gooch wrote: > > > error calling: "symlink" in "GLOBAL" > > > error calling: "symlink" in "GLOBAL" > > > error calling: "symlink" in "GLOBAL" > > > > > > When you do "killall -1 devfsd" to reload the config you often see errors > > > such as the above. These are because of "CFUNCTION GLOBAL symlink" > > > events trying to create the link a second time. > > > > > > I have attached a patch that fixes this issue. It has special case > > > code for "GLOBAL symlink" which calls an internal function instead > > > of the libc function (to preserve config file compatibility). This > > > function does the usual symlink operation but gives no error message > > > when the link as desired is already there (if you ask for "symlink > > > $devname modem" and there is already a symlink /dev/modem pointing > > > at /dev/$devname then it's not an error IMHO). When there is a real > > > error it gives slightly more information. > > > > > > Richard, please consider this for inclusion in the main tree. > > > > Sorry, but I hate it. The worst offence is to put special-case hacks > > into the parser. That's just too ugly for words. I'm also uneasy about > > wrapping C-library functions. > > I was half expecting that response. > > > My preferred solution to this (something I've been thinking about > > for a while because it's generally useful) is to allow options to be > > specified for actions. So you would have something like this: > > REGISTER ^cdrom/cdrom0$ CFUNCTION,nowarn GLOBAL symlink cdroms/cdrom0 > > cdrom > > So we don't warn if the user tries to create a symlink in a > non-existant directory, try to replace a device node with a symlink, > or do any of the other possible errors? Correct. Is that so bad? > If we're going to change the config file then why not make it: > REGISTER ^cdrom/cdrom0$ CFUNCTION GLOBAL devsymlink cdroms/cdrom0 cdrom > > Then we have a devsymlink() function internal to devfsd which does > something similar to what I've proposed. What bothers me is that in time, people will call for other C library functions to be wrapped. Bloat, bloat, bloat. I don't want to set a trend. So if instead we have a nowarn option, people have a way of shutting up symlink(2), and it sets the trend to use options. The number of options asked for will likely be less than the number of C library wrappers. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Wed Nov 7 07:50:31 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fA7FoV027953 for devfs-outgoing; Wed, 7 Nov 2001 07:50:31 -0800 Received: from sabi.co.UK (sabi.claranet.co.uk [212.126.138.20]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fA7FoI027947 for ; Wed, 7 Nov 2001 07:50:20 -0800 Received: from localhost ([127.0.0.1] helo=home.sabi.co.UK ident=piercarl) by sabi.co.UK with esmtp (Exim 3.16 #1) id 161Uwf-0000Kc-00 for devfs@OSS.SGI.com; Wed, 07 Nov 2001 15:48:53 +0000 X-Face: SMJE]JPYVBO-9UR%/8d'mG.F!@.,l@c[f'[%S8'BZIcbQc3/">GrXDwb#;fTRGNmHr^JFbS AptvwWc,0+z+~p~"Gdr4H$(|N(yF(wwCM2bW0~U?HPEE^fkPGx^u[*[yV.gyB!hDOli}EF[\cW*SH< GG"+i\3#fp@@EeWZWBv;]LA5n1pS2VO%Vv[yH?kY'lEWr30WfIU?%>&spRGFL}{`bj1TaD^l/"[msn (/TH#THs{Hpj>)]f> Subject: all praise devfs From: pg_mh@sabi.Clara.co.UK (Piercarlo Grandi) X-Disclaimer: This message contains only personal opinions Date: 07 Nov 2001 15:48:53 +0000 Message-ID: Lines: 8 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-devfs@oss.sgi.com Precedence: bulk I have just update my SuSE installation to 7.3 from 7.2; well, the SuSEn '/dev/' now has almost caught up with the Mandrake etc. ones, and has nearly 8000 entries, up from nearly 3500 in 7.2. Currently my '/dev/', with devfs, (and with a lot of drivers, and a lot of compatibility entries), has less than 900 entries. Thanks again for devfs! From owner-devfs@oss.sgi.com Wed Nov 7 17:45:08 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fA81j8E18768 for devfs-outgoing; Wed, 7 Nov 2001 17:45: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 fA81j6018765 for ; Wed, 7 Nov 2001 17:45:06 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fA81iuk16740; Wed, 7 Nov 2001 18:44:56 -0700 Date: Wed, 7 Nov 2001 18:44:56 -0700 Message-Id: <200111080144.fA81iuk16740@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: devfs@oss.sgi.com Subject: [PATCH] Next cut of new devfs core Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Another cut of the new devfs core. This should get the low-level append/unregister/unlink/rmdir working properly. Patch against 2.4.14. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca diff -urN linux-2.4.14/fs/devfs/base.c linux/fs/devfs/base.c --- linux-2.4.14/fs/devfs/base.c Sat Nov 3 11:06:38 2001 +++ linux/fs/devfs/base.c Wed Nov 7 12:11:25 2001 @@ -545,21 +545,15 @@ 20010919 Richard Gooch Set inode->i_mapping->a_ops for block nodes in . v0.116 - 20010927 Richard Gooch - Went back to global rwsem for symlinks (refcount scheme no good) - v0.117 20011008 Richard Gooch Fixed overrun in by removing function (not needed). - v0.118 20011009 Richard Gooch Fixed buffer underrun in . - Moved down_read() from to - v0.119 20011029 Richard Gooch Fixed race in when setting event mask. - 20011103 Richard Gooch - Avoid deadlock in by using temporary buffer. - v0.120 + 20011107 Richard Gooch + Pre-alpha cut of new locking code. + v1.0-pre3 */ #include #include @@ -592,7 +586,7 @@ #include #include -#define DEVFS_VERSION "0.120 (20011103)" +#define DEVFS_VERSION "1.0-pre3 (20011107)" #define DEVFS_NAME "devfs" @@ -605,14 +599,14 @@ # define FALSE 0 #endif -#define IS_HIDDEN(de) (( ((de)->hide && !is_devfsd_or_child(fs_info)) || !(de)->registered)) +#define IS_HIDDEN(de) ( (de)->hide && !is_devfsd_or_child(fs_info) ) #define DEBUG_NONE 0x00000 #define DEBUG_MODULE_LOAD 0x00001 #define DEBUG_REGISTER 0x00002 #define DEBUG_UNREGISTER 0x00004 #define DEBUG_SET_FLAGS 0x00008 -#define DEBUG_S_PUT 0x00010 +#define DEBUG_S_READ 0x00010 #define DEBUG_I_LOOKUP 0x00020 #define DEBUG_I_CREATE 0x00040 #define DEBUG_I_GET 0x00080 @@ -638,9 +632,11 @@ struct directory_type { + rwlock_t lock; /* Lock for searching(R)/updating(W) */ struct devfs_entry *first; struct devfs_entry *last; - unsigned int num_removable; + unsigned short num_removable; + unsigned char no_more_additions:1; }; struct file_type @@ -684,12 +680,12 @@ gid_t gid; }; -struct devfs_inode /* This structure is for "persistent" inode storage */ +struct devfs_inode /* This structure is for "persistent" inode storage */ { time_t atime; time_t mtime; time_t ctime; - unsigned int ino; /* Inode number as seen in the VFS */ + unsigned int ino; /* Inode number as seen in the VFS */ struct dentry *dentry; umode_t mode; uid_t uid; @@ -699,6 +695,7 @@ struct devfs_entry { void *info; + atomic_t refcount; /* When this drops to zero, it's unused */ union { struct directory_type dir; @@ -713,12 +710,11 @@ struct devfs_entry *slave; /* Another entry to unregister */ struct devfs_inode inode; umode_t mode; - unsigned short namelen; /* I think 64k+ filenames are a way off... */ - unsigned char registered:1; + unsigned short namelen; /* I think 64k+ filenames are a way off... */ unsigned char hide:1; - unsigned char no_persistence:1; - char name[1]; /* This is just a dummy: the allocated array is - bigger. This is NULL-terminated */ + unsigned char vfs_created:1; /* Whether created by driver or VFS */ + char name[1]; /* This is just a dummy: the allocated array + is bigger. This is NULL-terminated */ }; /* The root of the device tree */ @@ -733,7 +729,7 @@ gid_t gid; }; -struct fs_info /* This structure is for the mounted devfs */ +struct fs_info /* This structure is for the mounted devfs */ { struct super_block *sb; volatile struct devfsd_buf_entry *devfsd_buffer; @@ -763,14 +759,10 @@ static unsigned int boot_options = OPTION_NONE; #endif -static DECLARE_RWSEM (symlink_rwsem); - /* Forward function declarations */ -static struct devfs_entry *search_for_entry (struct devfs_entry *dir, - const char *name, - unsigned int namelen, int mkdir, - int mkfile, int *is_new, - int traverse_symlink); +static devfs_handle_t _devfs_walk_path (struct devfs_entry *dir, + const char *name, int namelen, + int traverse_symlink); static ssize_t devfsd_read (struct file *file, char *buf, size_t len, loff_t *ppos); static int devfsd_ioctl (struct inode *inode, struct file *file, @@ -791,22 +783,52 @@ /** - * search_for_entry_in_dir - Search for a devfs entry inside another devfs entry. + * devfs_get - Get a reference to a devfs entry. + * @de: The devfs entry. + */ + +static struct devfs_entry *devfs_get (struct devfs_entry *de) +{ + if (de) atomic_inc (&de->refcount); + return de; +} /* End Function devfs_get */ + +/** + * devfs_put - Put (release) a reference to a devfs entry. + * @de: The devfs entry. + */ + +static void devfs_put (struct devfs_entry *de) +{ + if (!de) return; + if ( !atomic_dec_and_test (&de->refcount) ) return; + if ( S_ISLNK (de->mode) ) kfree (de->u.symlink.linkname); + if ( ( S_ISCHR (de->mode) || S_ISBLK (de->mode) ) && de->u.fcb.autogen ) + { + devfs_dealloc_devnum ( S_ISCHR (de->mode) ? DEVFS_SPECIAL_CHR : + DEVFS_SPECIAL_BLK, + MKDEV (de->u.fcb.u.device.major, + de->u.fcb.u.device.minor) ); + } + kfree (de); +} /* End Function devfs_put */ + +/** + * _devfs_search_dir - Search for a devfs entry inside another devfs entry. * @parent: The parent devfs entry. * @name: The name of the entry. * @namelen: The number of characters in @name. - * @traverse_symlink: If %TRUE then the entry is traversed if it is a symlink. * * Search for a devfs entry inside another devfs entry and returns a pointer - * to the entry on success, else %NULL. + * to the entry on success, else %NULL. The parent must be locked already. + * An implicit devfs_get() is performed on the returned entry. */ -static struct devfs_entry *search_for_entry_in_dir (struct devfs_entry *parent, - const char *name, - unsigned int namelen, - int traverse_symlink) +static struct devfs_entry *_devfs_search_dir (struct devfs_entry *parent, + const char *name, + unsigned int namelen) { - struct devfs_entry *curr, *retval; + struct devfs_entry *curr; if ( !S_ISDIR (parent->mode) ) { @@ -819,18 +841,21 @@ if (memcmp (curr->name, name, namelen) == 0) break; /* Not found: try the next one */ } - if (curr == NULL) return NULL; - if (!S_ISLNK (curr->mode) || !traverse_symlink) return curr; - /* Need to follow the link: this is a stack chomper */ - retval = curr->registered ? - search_for_entry (parent, curr->u.symlink.linkname, - curr->u.symlink.length, FALSE, FALSE, NULL, - TRUE) : NULL; - return retval; -} /* End Function search_for_entry_in_dir */ + return devfs_get (curr); +} /* End Function _devfs_search_dir */ -static struct devfs_entry *create_entry (struct devfs_entry *parent, - const char *name,unsigned int namelen) + +/** + * _devfs_alloc_entry - Allocate a devfs entry. + * @name: The name of the entry. + * @namelen: The number of characters in @name. + * + * Allocate a devfs entry and returns a pointer to the entry on success, else + * %NULL. + */ + +static struct devfs_entry *_devfs_alloc_entry (const char *name, + unsigned int namelen) { struct devfs_entry *new; static unsigned long inode_counter = FIRST_INODE; @@ -842,20 +867,79 @@ /* Magic: this will set the ctime to zero, thus subsequent lookups will trigger the call to */ memset (new, 0, sizeof *new + namelen); + atomic_set (&new->refcount, 1); spin_lock (&counter_lock); new->inode.ino = inode_counter++; spin_unlock (&counter_lock); - new->parent = parent; if (name) memcpy (new->name, name, namelen); new->namelen = namelen; - if (parent == NULL) return new; - new->prev = parent->u.dir.last; - /* Insert into the parent directory's list of children */ - if (parent->u.dir.first == NULL) parent->u.dir.first = new; - else parent->u.dir.last->next = new; - parent->u.dir.last = new; return new; -} /* End Function create_entry */ +} /* End Function _devfs_alloc_entry */ + + +/** + * _devfs_alloc_dir - Allocate and initialise a devfs directory. + * @name: The name of the entry. + * @namelen: The number of characters in @name. + * + * Allocate a devfs directory and returns a pointer to the entry on success, else + * %NULL. + */ + +static devfs_handle_t _devfs_alloc_dir (const char *name, unsigned int namelen) +{ + struct devfs_entry *de; + + if ( ( de = _devfs_alloc_entry (name, namelen) ) == NULL ) return NULL; + de->mode = S_IFDIR | S_IRUGO | S_IXUGO; + rwlock_init (&de->u.dir.lock); + return de; +} /* End Function _devfs_alloc_dir */ + + +/** + * append_entry - Append a devfs entry to a directory's list of children. + * @dir: The directory to add to. + * @de: The devfs entry to append. + * + * Append a devfs entry to a directory's list of children, checking first to + * see if an entry of the same name exists. The directory will be locked. + * The value 0 is returned on success, else a negative error code. + */ + +static int append_entry (struct devfs_entry *dir, struct devfs_entry *de) +{ + int retval; + struct devfs_entry *old; + + if (!de || !dir) return 0; + if ( !S_ISDIR (dir->mode) ) + { + printk ("%s: append_entry(): dir: \"%s\" is not a directory\n", + DEVFS_NAME, dir->name); + return -ENOTDIR; + } + write_lock (&dir->u.dir.lock); + if (dir->u.dir.no_more_additions) retval = -ENOENT; + else + { + old = _devfs_search_dir (dir, de->name, de->namelen); + devfs_put (old); + if (old == NULL) + { + de->parent = dir; + de->prev = dir->u.dir.last; + /* Append to the directory's list of children */ + if (dir->u.dir.first == NULL) dir->u.dir.first = de; + else dir->u.dir.last->next = de; + dir->u.dir.last = de; + retval = 0; + } + else retval = -EEXIST; + } + write_unlock (&dir->u.dir.lock); + return retval; +} /* End Function append_entry */ static void update_devfs_inode_from_entry (struct devfs_entry *de) { @@ -889,26 +973,33 @@ } /* End Function update_devfs_inode_from_entry */ /** - * get_root_entry - Get the root devfs entry. + * _devfs_get_root_entry - Get the root devfs entry. * * Returns the root devfs entry on success, else %NULL. */ -static struct devfs_entry *get_root_entry (void) +static struct devfs_entry *_devfs_get_root_entry (void) { kdev_t devnum; struct devfs_entry *new; + static spinlock_t root_lock = SPIN_LOCK_UNLOCKED; /* Always ensure the root is created */ - if (root_entry != NULL) return root_entry; - if ( ( root_entry = create_entry (NULL, NULL, 0) ) == NULL ) return NULL; - root_entry->mode = S_IFDIR; + if (root_entry) return root_entry; + if ( ( new = _devfs_alloc_dir (NULL, 0) ) == NULL ) return NULL; /* Force an inode update, because lookup() is never done for the root */ - update_devfs_inode_from_entry (root_entry); - root_entry->registered = TRUE; + update_devfs_inode_from_entry (new); + spin_lock (&root_lock); + if (root_entry) + { + spin_unlock (&root_lock); + devfs_put (new); + return (root_entry); + } + root_entry = new; + spin_unlock (&root_lock); /* And create the entry for ".devfsd" */ - if ( ( new = create_entry (root_entry, ".devfsd", 0) ) == NULL ) - return NULL; + if ( ( new = _devfs_alloc_entry (".devfsd", 0) ) == NULL ) return NULL; devnum = devfs_alloc_devnum (DEVFS_SPECIAL_CHR); new->u.fcb.u.device.major = MAJOR (devnum); new->u.fcb.u.device.minor = MINOR (devnum); @@ -916,91 +1007,140 @@ new->u.fcb.default_uid = 0; new->u.fcb.default_gid = 0; new->u.fcb.ops = &devfsd_fops; - new->registered = TRUE; + append_entry (root_entry, new); return root_entry; -} /* End Function get_root_entry */ +} /* End Function _devfs_get_root_entry */ -/** - * search_for_entry - Search for an entry in the devfs tree. - * @dir: The parent directory to search from. If this is %NULL the root is used - * @name: The name of the entry. - * @namelen: The number of characters in @name. - * @mkdir: If %TRUE intermediate directories are created as needed. - * @mkfile: If %TRUE the file entry is created if it doesn't exist. - * @is_new: If the returned entry was newly made, %TRUE is written here. If - * this is %NULL nothing is written here. - * @traverse_symlink: If %TRUE then symbolic links are traversed. - * - * If the entry is created, then it will be in the unregistered state. - * Returns a pointer to the entry on success, else %NULL. - */ - -static struct devfs_entry *search_for_entry (struct devfs_entry *dir, - const char *name, - unsigned int namelen, int mkdir, - int mkfile, int *is_new, - int traverse_symlink) +static struct devfs_entry *_devfs_descend (struct devfs_entry *dir, + const char *name, int namelen, + int *next_pos) { - int len; - const char *subname, *stop, *ptr; + const char *stop, *ptr; struct devfs_entry *entry; - if (is_new) *is_new = FALSE; - if (dir == NULL) dir = get_root_entry (); - if (dir == NULL) return NULL; - /* Extract one filename component */ - subname = name; + if ( (namelen >= 3) && (strncmp (name, "../", 3) == 0) ) + { /* Special-case going to parent directory */ + *next_pos = 3; + return devfs_get (dir->parent); + } stop = name + namelen; - while (subname < stop) + /* Search for a possible '/' */ + for (ptr = name; (ptr < stop) && (*ptr != '/'); ++ptr); + *next_pos = ptr - name; + read_lock (&dir->u.dir.lock); + entry = _devfs_search_dir (dir, name, *next_pos); + read_unlock (&dir->u.dir.lock); + return entry; +} /* End Function _devfs_descend */ + + +static devfs_handle_t _devfs_make_parent_for_leaf (struct devfs_entry *dir, + const char *name, + int namelen, int *leaf_pos) +{ + int next_pos = 0; + struct devfs_entry *de; + + if (dir == NULL) dir = _devfs_get_root_entry (); + if (dir == NULL) return NULL; + devfs_get (dir); + /* Search for possible trailing component and ignore it */ + for (--namelen; (namelen > 0) && (name[namelen] != '/'); --namelen); + *leaf_pos = (name[namelen] == '/') ? (namelen + 1) : 0; + for (; namelen > 0; name += next_pos, namelen -= next_pos) { - /* Search for a possible '/' */ - for (ptr = subname; (ptr < stop) && (*ptr != '/'); ++ptr); - if (ptr >= stop) - { - /* Look for trailing component */ - len = stop - subname; - entry = search_for_entry_in_dir (dir, subname, len, - traverse_symlink); - if (entry != NULL) return entry; - if (!mkfile) return NULL; - entry = create_entry (dir, subname, len); - if (entry && is_new) *is_new = TRUE; - return entry; - } - /* Found '/': search for directory */ - if (strncmp (subname, "../", 3) == 0) + if ( ( de = _devfs_descend (dir, name, namelen, &next_pos) ) == NULL ) { - /* Going up */ - dir = dir->parent; - if (dir == NULL) return NULL; /* Cannot escape from devfs */ - subname += 3; - continue; + if ( ( de = _devfs_alloc_dir (name, next_pos) ) == NULL ) + { + devfs_put (dir); + return NULL; + } + if ( append_entry (dir, de) ) + { + devfs_put (dir); + devfs_put (de); + return NULL; + } + devfs_get (de); } - len = ptr - subname; - entry = search_for_entry_in_dir (dir, subname, len, traverse_symlink); - if (!entry && !mkdir) return NULL; - if (entry == NULL) + if (de == dir->parent) { - /* Make it */ - if ( ( entry = create_entry (dir, subname, len) ) == NULL ) - return NULL; - entry->mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; - if (is_new) *is_new = TRUE; + devfs_put (dir); + devfs_put (de); + return NULL; } - if ( !S_ISDIR (entry->mode) ) + devfs_put (dir); + dir = de; + if (name[next_pos] == '/') ++next_pos; + } + return dir; +} /* End Function _devfs_make_parent_for_leaf */ + + +static devfs_handle_t _devfs_prepare_leaf (devfs_handle_t *dir, + const char *name) +{ + int namelen, leaf_pos; + struct devfs_entry *de; + + namelen = strlen (name); + if ( ( *dir = _devfs_make_parent_for_leaf (*dir, name, namelen, + &leaf_pos) ) == NULL ) + { + printk ("%s: prepare_leaf(%s): could not create parent path\n", + DEVFS_NAME, name); + return NULL; + } + if ( ( de = _devfs_alloc_entry (name + leaf_pos, namelen - leaf_pos) ) + == NULL ) + { + printk ("%s: prepare_leaf(%s): could not allocate entry\n", + DEVFS_NAME, name); + devfs_put (*dir); + return NULL; + } + return de; +} /* End Function _devfs_prepare_leaf */ + + +static devfs_handle_t _devfs_walk_path (struct devfs_entry *dir, + const char *name, int namelen, + int traverse_symlink) +{ + int next_pos = 0; + + if (dir == NULL) dir = _devfs_get_root_entry (); + if (dir == NULL) return NULL; + devfs_get (dir); + for (; namelen > 0; name += next_pos, namelen -= next_pos) + { + struct devfs_entry *de, *link; + + if ( ( de = _devfs_descend (dir, name, namelen, &next_pos) ) == NULL ) { - printk ("%s: existing non-directory entry\n", DEVFS_NAME); + devfs_put (dir); return NULL; } - /* Ensure an unregistered entry is re-registered and visible */ - entry->hide = FALSE; - entry->registered = TRUE; - subname = ptr + 1; - dir = entry; + if (S_ISLNK (de->mode) && traverse_symlink) + { /* Need to follow the link: this is a stack chomper */ + link = _devfs_walk_path (dir, de->u.symlink.linkname, + de->u.symlink.length, TRUE); + devfs_put (de); + if (!link) + { + devfs_put (dir); + return NULL; + } + de = link; + } + devfs_put (dir); + dir = de; + if (name[next_pos] == '/') ++next_pos; } - return NULL; -} /* End Function search_for_entry */ + return dir; +} /* End Function _devfs_walk_path */ /** @@ -1063,7 +1203,6 @@ * %DEVFS_SPECIAL_CHR or %DEVFS_SPECIAL_BLK. * @traverse_symlink: If %TRUE then symbolic links are traversed. * - * FIXME: What the hell is @handle? - ch * Returns the devfs_entry pointer on success, else %NULL. */ @@ -1095,10 +1234,7 @@ ++name; --namelen; } - if (traverse_symlink) down_read (&symlink_rwsem); - entry = search_for_entry (dir, name, namelen, FALSE, FALSE, NULL, - traverse_symlink); - if (traverse_symlink) up_read (&symlink_rwsem); + entry = _devfs_walk_path (dir, name, namelen, traverse_symlink); if (entry != NULL) return entry; } /* Have to search by major and minor: slow */ @@ -1114,7 +1250,7 @@ if (inode == NULL) return NULL; de = inode->u.generic_ip; if (!de) printk (__FUNCTION__ "(): NULL de for inode %ld\n", inode->i_ino); - if (do_check && de && !de->registered) de = NULL; + /*FIXME: what to do with do_check? */ return de; } /* End Function get_devfs_entry_from_vfs_inode */ @@ -1201,8 +1337,9 @@ /** - * devfsd_notify_one - Notify a single devfsd daemon of a change. - * @data: Data to be passed. + * devfsd_notify_one - Notify the devfsd daemon of a change. + * @data: Data to be passed. This must remain in scope until devfsd has + * processed the event. * @type: The type of change. * @mode: The mode of the entry. * @uid: The user ID. @@ -1246,17 +1383,43 @@ /** - * devfsd_notify - Notify all devfsd daemons of a change. + * devfsd_notify_de - Notify the devfsd daemon of a change. + * @de: The devfs entry that has changed. This and all parent entries will + * have their reference counts incremented if the event was queued. + * @type: The type of change. + * @mode: The mode of the entry. + * @uid: The user ID. + * @gid: The group ID. + * @fs_info: The filesystem info. + * + * Returns %TRUE if an event was queued and devfsd woken up, else %FALSE. + */ + +static int devfsd_notify_de (struct devfs_entry *de, + unsigned int type, umode_t mode, + uid_t uid, gid_t gid, struct fs_info *fs_info) +{ + if ( devfsd_notify_one (de, type, mode, uid, gid, fs_info) ) + { + for (; de != NULL; de = de->parent) devfs_get (de); + return (TRUE); + } + return (FALSE); +} /* End Function devfsd_notify_de */ + + +/** + * devfsd_notify - Notify the devfsd daemon of a change. * @de: The devfs entry that has changed. * @type: The type of change event. - * @wait: If TRUE, the functions waits for all daemons to finish processing + * @wait: If TRUE, the function waits for the daemon to finish processing * the event. */ static void devfsd_notify (struct devfs_entry *de, unsigned int type, int wait) { - if (devfsd_notify_one (de, type, de->mode, current->euid, - current->egid, &fs_info) && wait) + if (devfsd_notify_de (de, type, de->mode, current->euid, + current->egid, &fs_info) && wait) wait_for_devfsd_finished (&fs_info); } /* End Function devfsd_notify */ @@ -1287,7 +1450,6 @@ umode_t mode, void *ops, void *info) { char devtype = S_ISCHR (mode) ? DEVFS_SPECIAL_CHR : DEVFS_SPECIAL_BLK; - int is_new; kdev_t devnum = NODEV; struct devfs_entry *de; @@ -1332,39 +1494,13 @@ major = MAJOR (devnum); minor = MINOR (devnum); } - de = search_for_entry (dir, name, strlen (name), TRUE, TRUE, &is_new, - FALSE); - if (de == NULL) + if ( ( de = _devfs_prepare_leaf (&dir, name) ) == NULL ) { - printk ("%s: devfs_register(): could not create entry: \"%s\"\n", + printk ("%s: devfs_register(%s): could not prepare leaf\n", DEVFS_NAME, name); if (devnum != NODEV) devfs_dealloc_devnum (devtype, devnum); return NULL; } -#ifdef CONFIG_DEVFS_DEBUG - if (devfs_debug & DEBUG_REGISTER) - printk ("%s: devfs_register(%s): de: %p %s\n", - DEVFS_NAME, name, de, is_new ? "new" : "existing"); -#endif - if (!is_new) - { - /* Existing entry */ - if ( !S_ISCHR (de->mode) && !S_ISBLK (de->mode) && - !S_ISREG (de->mode) ) - { - printk ("%s: devfs_register(): existing non-device/file entry: \"%s\"\n", - DEVFS_NAME, name); - if (devnum != NODEV) devfs_dealloc_devnum (devtype, devnum); - return NULL; - } - if (de->registered) - { - printk("%s: devfs_register(): device already registered: \"%s\"\n", - DEVFS_NAME, name); - if (devnum != NODEV) devfs_dealloc_devnum (devtype, devnum); - return NULL; - } - } de->u.fcb.autogen = FALSE; if ( S_ISCHR (mode) || S_ISBLK (mode) ) { @@ -1375,8 +1511,11 @@ else if ( S_ISREG (mode) ) de->u.fcb.u.file.size = 0; else { - printk ("%s: devfs_register(): illegal mode: %x\n", - DEVFS_NAME, mode); + printk ("%s: devfs_register(%s): illegal mode: %x\n", + DEVFS_NAME, name, mode); + devfs_put (de); + devfs_put (dir); + if (devnum != NODEV) devfs_dealloc_devnum (devtype, devnum); return (NULL); } de->info = info; @@ -1401,77 +1540,86 @@ } de->u.fcb.open = FALSE; de->hide = (flags & DEVFS_FL_HIDE) ? TRUE : FALSE; - de->no_persistence = (flags & DEVFS_FL_NO_PERSISTENCE) ? TRUE : FALSE; - de->registered = TRUE; + if ( append_entry (dir, de) ) + { + printk ("%s: devfs_register(%s): could not append to parent\n", + DEVFS_NAME, name); + devfs_put (de); + devfs_put (dir); + if (devnum != NODEV) devfs_dealloc_devnum (devtype, devnum); + return NULL; + } +#ifdef CONFIG_DEVFS_DEBUG + if (devfs_debug & DEBUG_REGISTER) + printk ("%s: devfs_register(%s): de: %p\n", DEVFS_NAME, name, de); +#endif devfsd_notify (de, DEVFSD_NOTIFY_REGISTERED, flags & DEVFS_FL_WAIT); + devfs_put (dir); return de; } /* End Function devfs_register */ /** - * unregister - Unregister a device entry. + * _devfs_unhook - Unhook a device entry from its parents list + * @de: The entry to unhook. + * + * Returns %TRUE if the entry was unhooked, else %FALSE if it was + * previously unhooked. + * The caller must have a write lock on the parent directory. + */ + +static int _devfs_unhook (struct devfs_entry *de) +{ + struct devfs_entry *parent; + + if ( !de || (de->prev == de) ) return FALSE; + parent = de->parent; + if (de->prev == NULL) parent->u.dir.first = de->next; + else de->prev->next = de->next; + if (de->next == NULL) parent->u.dir.last = de->prev; + else de->next->prev = de->prev; + de->prev = de; /* Indicate we're unhooked */ + de->next = NULL; /* Force early termination for */ + return TRUE; +} /* End Function _devfs_unhook */ + + +/** + * unregister - Unregister a device entry from it's parent. + * @dir: The parent directory. * @de: The entry to unregister. + * + * The caller must have a write lock on the parent directory, which is + * unlocked by this function. */ -static void unregister (struct devfs_entry *de) +static void unregister (struct devfs_entry *dir, struct devfs_entry *de) { - struct devfs_entry *child; + int unhooked = _devfs_unhook (de); - if ( (child = de->slave) != NULL ) - { - de->slave = NULL; /* Unhook first in case slave is parent directory */ - unregister (child); - } - if (de->registered) - { - devfsd_notify (de, DEVFSD_NOTIFY_UNREGISTERED, 0); - free_dentries (de); - } - de->info = NULL; - if ( S_ISCHR (de->mode) || S_ISBLK (de->mode) || S_ISREG (de->mode) ) - { - de->registered = FALSE; - de->u.fcb.ops = NULL; - if (!S_ISREG (de->mode) && de->u.fcb.autogen) - { - devfs_dealloc_devnum ( S_ISCHR (de->mode) ? DEVFS_SPECIAL_CHR : - DEVFS_SPECIAL_BLK, - MKDEV (de->u.fcb.u.device.major, - de->u.fcb.u.device.minor) ); - } - de->u.fcb.autogen = FALSE; - return; - } - if (S_ISLNK (de->mode) && de->registered) - { - de->registered = FALSE; - down_write (&symlink_rwsem); - if (de->u.symlink.linkname) kfree (de->u.symlink.linkname); - de->u.symlink.linkname = NULL; - up_write (&symlink_rwsem); - return; - } - if ( S_ISFIFO (de->mode) ) - { - de->registered = FALSE; - return; - } - if (!de->registered) return; - if ( !S_ISDIR (de->mode) ) - { - printk ("%s: unregister(): unsupported type\n", DEVFS_NAME); - return; - } - de->registered = FALSE; - /* Now recursively search the subdirectories: this is a stack chomper */ - for (child = de->u.dir.first; child != NULL; child = child->next) - { + write_unlock (&dir->u.dir.lock); + if (!unhooked) return; + devfs_get (dir); + devfs_unregister (de->slave); /* Let it handle the locking */ + devfsd_notify (de, DEVFSD_NOTIFY_UNREGISTERED, 0); + free_dentries (de); + devfs_put (dir); + if ( !S_ISDIR (de->mode) ) return; + while (TRUE) /* Recursively unregister: this is a stack chomper */ + { + struct devfs_entry *child; + + write_lock (&de->u.dir.lock); + de->u.dir.no_more_additions = TRUE; + child = de->u.dir.first; + unregister (de, child); + if (!child) break; #ifdef CONFIG_DEVFS_DEBUG if (devfs_debug & DEBUG_UNREGISTER) printk ("%s: unregister(): child->name: \"%s\" child: %p\n", DEVFS_NAME, child->name, child); #endif - unregister (child); + devfs_put (child); } } /* End Function unregister */ @@ -1484,20 +1632,21 @@ void devfs_unregister (devfs_handle_t de) { - if (de == NULL) return; + if ( (de == NULL) || (de->parent == NULL) ) return; #ifdef CONFIG_DEVFS_DEBUG if (devfs_debug & DEBUG_UNREGISTER) printk ("%s: devfs_unregister(): de->name: \"%s\" de: %p\n", DEVFS_NAME, de->name, de); #endif - unregister (de); + write_lock (&de->parent->u.dir.lock); + unregister (de->parent, de); + devfs_put (de); } /* End Function devfs_unregister */ static int devfs_do_symlink (devfs_handle_t dir, const char *name, unsigned int flags, const char *link, devfs_handle_t *handle, void *info) { - int is_new; unsigned int linklength; char *newlink; struct devfs_entry *de; @@ -1522,28 +1671,27 @@ return -ENOMEM; memcpy (newlink, link, linklength); newlink[linklength] = '\0'; - if ( ( de = search_for_entry (dir, name, strlen (name), TRUE, TRUE, - &is_new, FALSE) ) == NULL ) + if ( ( de = _devfs_prepare_leaf (&dir, name) ) == NULL ) { - kfree (newlink); - return -ENOMEM; - } - down_write (&symlink_rwsem); - if (de->registered) - { - up_write (&symlink_rwsem); - kfree (newlink); - printk ("%s: devfs_do_symlink(%s): entry already exists\n", + printk ("%s: devfs_do_symlink(%s): could not prepare leaf\n", DEVFS_NAME, name); - return -EEXIST; + kfree (newlink); + return -ENOTDIR; } de->mode = S_IFLNK | S_IRUGO | S_IXUGO; de->info = info; de->hide = (flags & DEVFS_FL_HIDE) ? TRUE : FALSE; de->u.symlink.linkname = newlink; de->u.symlink.length = linklength; - de->registered = TRUE; - up_write (&symlink_rwsem); + if ( append_entry (dir, de) ) + { + printk ("%s: devfs_do_symlink(%s): could not append to parent\n", + DEVFS_NAME, name); + devfs_put (de); + devfs_put (dir); + return -EEXIST; + } + devfs_put (dir); if (handle != NULL) *handle = de; return 0; } /* End Function devfs_do_symlink */ @@ -1593,7 +1741,6 @@ devfs_handle_t devfs_mk_dir (devfs_handle_t dir, const char *name, void *info) { - int is_new; struct devfs_entry *de; if (name == NULL) @@ -1601,36 +1748,28 @@ printk ("%s: devfs_mk_dir(): NULL name pointer\n", DEVFS_NAME); return NULL; } - de = search_for_entry (dir, name, strlen (name), TRUE, TRUE, &is_new, - FALSE); - if (de == NULL) + if ( ( de = _devfs_prepare_leaf (&dir, name) ) == NULL ) { - printk ("%s: devfs_mk_dir(): could not create entry: \"%s\"\n", + printk ("%s: devfs_mk_dir(%s): could not prepare leaf\n", DEVFS_NAME, name); return NULL; } - if (!S_ISDIR (de->mode) && de->registered) + de->mode = S_IFDIR | S_IRUGO | S_IXUGO; + de->info = info; + rwlock_init (&de->u.dir.lock); + if ( append_entry (dir, de) ) { - printk ("%s: devfs_mk_dir(): existing non-directory entry: \"%s\"\n", + printk ("%s: devfs_mk_dir(%s): could not append to parent\n", DEVFS_NAME, name); + devfs_put (de); + devfs_put (dir); return NULL; } #ifdef CONFIG_DEVFS_DEBUG if (devfs_debug & DEBUG_REGISTER) - printk ("%s: devfs_mk_dir(%s): de: %p %s\n", - DEVFS_NAME, name, de, is_new ? "new" : "existing"); + printk ("%s: devfs_mk_dir(%s): de: %p\n", DEVFS_NAME, name, de); #endif - if (!S_ISDIR (de->mode) && !is_new) - { - /* Transmogrifying an old entry */ - de->u.dir.first = NULL; - de->u.dir.last = NULL; - } - de->mode = S_IFDIR | S_IRUGO | S_IXUGO; - de->info = info; - if (!de->registered) de->u.dir.num_removable = 0; - de->hide = FALSE; - de->registered = TRUE; + devfs_put (dir); return de; } /* End Function devfs_mk_dir */ @@ -1659,9 +1798,9 @@ devfs_handle_t de; if ( (name != NULL) && (name[0] == '\0') ) name = NULL; - de = find_entry (dir, name, 0, major, minor, type, traverse_symlinks); + de = find_entry (dir, name, 0, major, minor, type, + traverse_symlinks); if (de == NULL) return NULL; - if (!de->registered) return NULL; return de; } /* End Function devfs_find_handle */ @@ -1679,7 +1818,6 @@ unsigned int fl = 0; if (de == NULL) return -EINVAL; - if (!de->registered) return -ENODEV; if (de->hide) fl |= DEVFS_FL_HIDE; if ( S_ISCHR (de->mode) || S_ISBLK (de->mode) || S_ISREG (de->mode) ) { @@ -1703,7 +1841,6 @@ int devfs_set_flags (devfs_handle_t de, unsigned int flags) { if (de == NULL) return -EINVAL; - if (!de->registered) return -ENODEV; #ifdef CONFIG_DEVFS_DEBUG if (devfs_debug & DEBUG_SET_FLAGS) printk ("%s: devfs_set_flags(): de->name: \"%s\"\n", @@ -1742,7 +1879,6 @@ unsigned int *minor) { if (de == NULL) return -EINVAL; - if (!de->registered) return -ENODEV; if ( S_ISDIR (de->mode) ) return -EISDIR; if ( !S_ISCHR (de->mode) && !S_ISBLK (de->mode) ) return -EINVAL; if (major != NULL) *major = de->u.fcb.u.device.major; @@ -1808,7 +1944,6 @@ void *devfs_get_ops (devfs_handle_t de) { if (de == NULL) return NULL; - if (!de->registered) return NULL; if ( S_ISCHR (de->mode) || S_ISBLK (de->mode) || S_ISREG (de->mode) ) return de->u.fcb.ops; return NULL; @@ -1826,7 +1961,6 @@ int devfs_set_file_size (devfs_handle_t de, unsigned long size) { if (de == NULL) return -EINVAL; - if (!de->registered) return -EINVAL; if ( !S_ISREG (de->mode) ) return -EINVAL; if (de->u.fcb.u.file.size == size) return 0; de->u.fcb.u.file.size = size; @@ -1846,7 +1980,6 @@ void *devfs_get_info (devfs_handle_t de) { if (de == NULL) return NULL; - if (!de->registered) return NULL; return de->info; } /* End Function devfs_get_info */ @@ -1861,7 +1994,6 @@ int devfs_set_info (devfs_handle_t de, void *info) { if (de == NULL) return -EINVAL; - if (!de->registered) return -EINVAL; de->info = info; return 0; } /* End Function devfs_set_info */ @@ -1876,7 +2008,6 @@ devfs_handle_t devfs_get_parent (devfs_handle_t de) { if (de == NULL) return NULL; - if (!de->registered) return NULL; return de->parent; } /* End Function devfs_get_parent */ @@ -1891,7 +2022,6 @@ devfs_handle_t devfs_get_first_child (devfs_handle_t de) { if (de == NULL) return NULL; - if (!de->registered) return NULL; if ( !S_ISDIR (de->mode) ) return NULL; return de->u.dir.first; } /* End Function devfs_get_first_child */ @@ -1907,7 +2037,6 @@ devfs_handle_t devfs_get_next_sibling (devfs_handle_t de) { if (de == NULL) return NULL; - if (!de->registered) return NULL; return de->next; } /* End Function devfs_get_next_sibling */ @@ -1961,7 +2090,6 @@ const char *devfs_get_name (devfs_handle_t de, unsigned int *namelen) { if (de == NULL) return NULL; - if (!de->registered) return NULL; if (namelen != NULL) *namelen = de->namelen; return de->name; } /* End Function devfs_get_name */ @@ -2059,6 +2187,7 @@ {"dunreg", DEBUG_UNREGISTER, &devfs_debug_init}, {"diget", DEBUG_I_GET, &devfs_debug_init}, {"dchange", DEBUG_SET_FLAGS, &devfs_debug_init}, + {"dsread", DEBUG_S_READ, &devfs_debug_init}, {"dichange", DEBUG_I_CHANGE, &devfs_debug_init}, {"dimknod", DEBUG_I_MKNOD, &devfs_debug_init}, {"dilookup", DEBUG_I_LOOKUP, &devfs_debug_init}, @@ -2129,13 +2258,13 @@ /** - * try_modload - Notify devfsd of an inode lookup. + * try_modload - Notify devfsd of an inode lookup by a non-devfsd process. * @parent: The parent devfs entry. * @fs_info: The filesystem info. * @name: The device name. * @namelen: The number of characters in @name. - * @buf: A working area that will be used. This must not go out of scope until - * devfsd is idle again. + * @buf: A working area that will be used. This must not go out of scope + * until devfsd is idle again. * * Returns 0 on success, else a negative error code. */ @@ -2206,7 +2335,6 @@ if (dir->u.dir.num_removable < 1) return; for (de = dir->u.dir.first; de != NULL; de = de->next) { - if (!de->registered) continue; if ( !S_ISBLK (de->mode) ) continue; if (!de->u.fcb.removable) continue; check_disc_changed (de); @@ -2229,7 +2357,6 @@ for (de = dir->u.dir.first; de != NULL; de = de->next) { - if (!de->registered) continue; if ( !S_ISBLK (de->mode) ) continue; if (!de->u.fcb.removable) continue; if (strcmp (de->name, "disc") == 0) return check_disc_changed (de); @@ -2283,8 +2410,8 @@ de->inode.mtime = inode->i_mtime; de->inode.ctime = inode->i_ctime; if ( iattr->ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID) ) - devfsd_notify_one (de, DEVFSD_NOTIFY_CHANGE, inode->i_mode, - inode->i_uid, inode->i_gid, fs_info); + devfsd_notify_de (de, DEVFSD_NOTIFY_CHANGE, inode->i_mode, + inode->i_uid, inode->i_gid, fs_info); return 0; } /* End Function devfs_notify_change */ @@ -2299,11 +2426,10 @@ return 0; } /* End Function devfs_statfs */ -static void devfs_clear_inode(struct inode *inode) +static void devfs_clear_inode (struct inode *inode) { - if (S_ISBLK(inode->i_mode)) - bdput(inode->i_bdev); -} + if ( S_ISBLK (inode->i_mode) ) bdput (inode->i_bdev); +} /* End Function devfs_clear_inode */ static struct super_operations devfs_sops = { @@ -2319,7 +2445,8 @@ * @de: The devfs inode. * @dentry: The dentry to register with the devfs inode. * - * Returns the inode on success, else %NULL. + * Returns the inode on success, else %NULL. An implicit devfs_get() is + * performed if the inode is created. */ static struct inode *get_vfs_inode (struct super_block *sb, @@ -2344,7 +2471,7 @@ return NULL; } de->inode.dentry = dentry; - inode->u.generic_ip = de; + inode->u.generic_ip = devfs_get (de); inode->i_ino = de->inode.ino; #ifdef CONFIG_DEVFS_DEBUG if (devfs_debug & DEBUG_I_GET) @@ -2366,7 +2493,7 @@ { inode->i_rdev = MKDEV (de->u.fcb.u.device.major, de->u.fcb.u.device.minor); - if (bd_acquire(inode) == 0) + if (bd_acquire (inode) == 0) { if (!inode->i_bdev->bd_op && de->u.fcb.ops) inode->i_bdev->bd_op = de->u.fcb.ops; @@ -2409,7 +2536,7 @@ int err, count; int stored = 0; struct fs_info *fs_info; - struct devfs_entry *parent, *de; + struct devfs_entry *parent, *de, *next = NULL; struct inode *inode = file->f_dentry->d_inode; fs_info = inode->i_sb->u.generic_sbp; @@ -2441,19 +2568,32 @@ default: /* Skip entries */ count = file->f_pos - 2; - for (de = parent->u.dir.first; (de != NULL) && (count > 0); - de = de->next) + read_lock (&parent->u.dir.lock); + for (de = parent->u.dir.first; de && (count > 0); de = de->next) if ( !IS_HIDDEN (de) ) --count; + devfs_get (de); + read_unlock (&parent->u.dir.lock); /* Now add all remaining entries */ - for (; de != NULL; de = de->next) + while (de) { - if ( IS_HIDDEN (de) ) continue; - err = (*filldir) (dirent, de->name, de->namelen, - file->f_pos, de->inode.ino, de->mode >> 12); + if ( IS_HIDDEN (de) ) err = 0; + else + { + err = (*filldir) (dirent, de->name, de->namelen, + file->f_pos, de->inode.ino, de->mode >> 12); + if (err >= 0) + { + file->f_pos++; + ++stored; + } + } + read_lock (&parent->u.dir.lock); + next = devfs_get (de->next); + read_unlock (&parent->u.dir.lock); + devfs_put (de); + de = next; if (err == -EINVAL) break; if (err < 0) return err; - file->f_pos++; - ++stored; } break; } @@ -2467,14 +2607,9 @@ struct devfs_entry *de; struct fs_info *fs_info = inode->i_sb->u.generic_sbp; - lock_kernel (); de = get_devfs_entry_from_vfs_inode (inode, TRUE); - err = -ENODEV; - if (de == NULL) - goto out; - err = 0; - if ( S_ISDIR (de->mode) ) - goto out; + if (de == NULL) return -ENODEV; + if ( S_ISDIR (de->mode) ) return 0; df = &de->u.fcb; file->private_data = de->info; if ( S_ISBLK (inode->i_mode) ) @@ -2482,7 +2617,7 @@ file->f_op = &def_blk_fops; if (df->ops) inode->i_bdev->bd_op = df->ops; } - else file->f_op = fops_get ( (struct file_operations*) df->ops ); + else file->f_op = fops_get ( (struct file_operations *) df->ops ); if (file->f_op) err = file->f_op->open ? (*file->f_op->open) (inode, file) : 0; else @@ -2491,10 +2626,9 @@ if ( S_ISCHR (inode->i_mode) ) err = chrdev_open (inode, file); else err = -ENODEV; } - if (err < 0) goto out; + if (err < 0) return err; /* Open was successful */ - err = 0; - if (df->open) goto out; + if (df->open) return 0; df->open = TRUE; /* This is the first open */ if (df->auto_owner) { @@ -2507,23 +2641,21 @@ inode->i_gid = de->inode.gid; } if (df->aopen_notify) - devfsd_notify_one (de, DEVFSD_NOTIFY_ASYNC_OPEN, inode->i_mode, - current->euid, current->egid, fs_info); -out: - unlock_kernel (); - return err; + devfsd_notify_de (de, DEVFSD_NOTIFY_ASYNC_OPEN, inode->i_mode, + current->euid, current->egid, fs_info); + return 0; } /* End Function devfs_open */ static struct file_operations devfs_fops = { - open: devfs_open, + open: devfs_open, }; static struct file_operations devfs_dir_fops = { - read: generic_read_dir, + read: generic_read_dir, readdir: devfs_readdir, - open: devfs_open, + open: devfs_open, }; @@ -2556,15 +2688,17 @@ { struct devfs_entry *de; - lock_kernel (); de = get_devfs_entry_from_vfs_inode (inode, FALSE); #ifdef CONFIG_DEVFS_DEBUG if (devfs_debug & DEBUG_D_IPUT) printk ("%s: d_iput(): dentry: %p inode: %p de: %p de->dentry: %p\n", DEVFS_NAME, dentry, inode, de, de->inode.dentry); #endif - if (de->inode.dentry == dentry) de->inode.dentry = NULL; - unlock_kernel (); + if (de->inode.dentry == dentry) /*FIXME: do I need this test? */ + { + de->inode.dentry = NULL; + devfs_put (de); + } iput (inode); } /* End Function devfs_d_iput */ @@ -2622,8 +2756,8 @@ if (!de->u.fcb.open) return 0; de->u.fcb.open = FALSE; if (de->u.fcb.aopen_notify) - devfsd_notify_one (de, DEVFSD_NOTIFY_CLOSE, inode->i_mode, - current->euid, current->egid, fs_info); + devfsd_notify_de (de, DEVFSD_NOTIFY_CLOSE, inode->i_mode, + current->euid, current->egid, fs_info); if (!de->u.fcb.auto_owner) return 0; /* Change the ownership/protection back */ de->inode.mode = (de->inode.mode & ~S_IALLUGO) | S_IRUGO | S_IWUGO; @@ -2641,10 +2775,9 @@ struct inode *dir; struct fs_info *fs_info; - lock_kernel (); dir = dentry->d_parent->d_inode; fs_info = dir->i_sb->u.generic_sbp; - if (!de || de->registered) + if (!de) { if ( !dentry->d_inode && is_devfsd_or_child (fs_info) ) { @@ -2666,30 +2799,28 @@ devfs_handle_t parent; parent = get_devfs_entry_from_vfs_inode (dir, TRUE); - de = search_for_entry_in_dir (parent, dentry->d_name.name, - dentry->d_name.len, FALSE); + de = _devfs_search_dir (parent, dentry->d_name.name, + dentry->d_name.len); } - if (de == NULL) goto out; + if (de == NULL) return 1; /* Create an inode, now that the driver information is available */ - if (de->no_persistence) update_devfs_inode_from_entry (de); - else if (de->inode.ctime == 0) update_devfs_inode_from_entry (de); + if (de->inode.ctime == 0) update_devfs_inode_from_entry (de); else de->inode.mode = (de->mode & ~S_IALLUGO) | (de->inode.mode & S_IALLUGO); - if ( ( inode = get_vfs_inode (dir->i_sb, de, dentry) ) == NULL ) - goto out; + inode = get_vfs_inode (dir->i_sb, de, dentry); + devfs_put (de); + if (!inode) return 1; #ifdef CONFIG_DEVFS_DEBUG if (devfs_debug & DEBUG_I_LOOKUP) printk ("%s: d_revalidate(): new VFS inode(%u): %p devfs_entry: %p\n", DEVFS_NAME, de->inode.ino, inode, de); #endif d_instantiate (dentry, inode); - goto out; + return 1; } } if ( wait_for_devfsd_finished (fs_info) ) dentry->d_op = &devfs_dops; -out: - unlock_kernel (); return 1; } /* End Function devfs_d_revalidate_wait */ @@ -2719,20 +2850,19 @@ DEVFS_NAME, txt, dentry, parent, current->comm); #endif if (parent == NULL) return ERR_PTR (-ENOENT); - /* Try to reclaim an existing devfs entry */ - de = search_for_entry_in_dir (parent, - dentry->d_name.name, dentry->d_name.len, - FALSE); - if ( ( (de == NULL) || !de->registered ) && - (parent->u.dir.num_removable > 0) && + read_lock (&parent->u.dir.lock); + de = _devfs_search_dir (parent, dentry->d_name.name, dentry->d_name.len); + read_unlock (&parent->u.dir.lock); + if ( (de == NULL) && (parent->u.dir.num_removable > 0) && get_removable_partition (parent, dentry->d_name.name, dentry->d_name.len) ) { - if (de == NULL) - de = search_for_entry_in_dir (parent, dentry->d_name.name, - dentry->d_name.len, FALSE); + read_lock (&parent->u.dir.lock); + de = _devfs_search_dir (parent, dentry->d_name.name, + dentry->d_name.len); + read_unlock (&parent->u.dir.lock); } - if ( (de == NULL) || !de->registered ) + if (de == NULL) { /* Try with devfsd. For any kind of failure, leave a negative dentry so someone else can deal with it (in the case where the sysadmin @@ -2747,7 +2877,6 @@ } /* devfsd claimed success */ dentry->d_op = &devfs_wait_dops; - dentry->d_fsdata = de; d_add (dentry, NULL); /* Open the floodgates */ /* Unlock directory semaphore, which will release any waiters. They will get the hashed dentry, and may be forced to wait for @@ -2758,10 +2887,10 @@ /* If someone else has been so kind as to make the inode, we go home early */ if (dentry->d_inode) return NULL; - if (de && !de->registered) return NULL; - if (de == NULL) - de = search_for_entry_in_dir (parent, dentry->d_name.name, - dentry->d_name.len, FALSE); + read_lock (&parent->u.dir.lock); + de = _devfs_search_dir (parent, dentry->d_name.name, + dentry->d_name.len); + read_unlock (&parent->u.dir.lock); if (de == NULL) return NULL; /* OK, there's an entry now, but no VFS inode yet */ } @@ -2771,12 +2900,12 @@ d_add (dentry, NULL); /* Open the floodgates */ } /* Create an inode, now that the driver information is available */ - if (de->no_persistence) update_devfs_inode_from_entry (de); - else if (de->inode.ctime == 0) update_devfs_inode_from_entry (de); + if (de->inode.ctime == 0) update_devfs_inode_from_entry (de); else de->inode.mode = (de->mode & ~S_IALLUGO) | (de->inode.mode & S_IALLUGO); - if ( ( inode = get_vfs_inode (dir->i_sb, de, dentry) ) == NULL ) - return ERR_PTR (-ENOMEM); + inode = get_vfs_inode (dir->i_sb, de, dentry); + devfs_put (de); + if (!inode) return ERR_PTR (-ENOMEM); #ifdef CONFIG_DEVFS_DEBUG if (devfs_debug & DEBUG_I_LOOKUP) printk ("%s: lookup(): new VFS inode(%u): %p devfs_entry: %p\n", @@ -2794,6 +2923,7 @@ static int devfs_unlink (struct inode *dir, struct dentry *dentry) { + int unhooked; struct devfs_entry *de; struct inode *inode = dentry->d_inode; @@ -2809,20 +2939,17 @@ } #endif - de = get_devfs_entry_from_vfs_inode (dentry->d_inode, TRUE); + de = get_devfs_entry_from_vfs_inode (inode, TRUE); if (de == NULL) return -ENOENT; - devfsd_notify_one (de, DEVFSD_NOTIFY_DELETE, inode->i_mode, - inode->i_uid, inode->i_gid, dir->i_sb->u.generic_sbp); - de->registered = FALSE; - de->hide = TRUE; - if ( S_ISLNK (de->mode) ) - { - down_write (&symlink_rwsem); - if (de->u.symlink.linkname) kfree (de->u.symlink.linkname); - de->u.symlink.linkname = NULL; - up_write (&symlink_rwsem); - } + if (!de->vfs_created) return -EPERM; + write_lock (&de->parent->u.dir.lock); + unhooked = _devfs_unhook (de); + write_unlock (&de->parent->u.dir.lock); + if (!unhooked) return -ENOENT; + devfsd_notify_de (de, DEVFSD_NOTIFY_DELETE, inode->i_mode, + inode->i_uid, inode->i_gid, dir->i_sb->u.generic_sbp); free_dentries (de); + devfs_put (de); return 0; } /* End Function devfs_unlink */ @@ -2846,6 +2973,7 @@ DEVFS_NAME, err); #endif if (err < 0) return err; + de->vfs_created = TRUE; de->inode.mode = de->mode; de->inode.atime = CURRENT_TIME; de->inode.mtime = CURRENT_TIME; @@ -2857,50 +2985,38 @@ printk ("%s: symlink(): new VFS inode(%u): %p dentry: %p\n", DEVFS_NAME, de->inode.ino, inode, dentry); #endif - de->hide = FALSE; d_instantiate (dentry, inode); - devfsd_notify_one (de, DEVFSD_NOTIFY_CREATE, inode->i_mode, - inode->i_uid, inode->i_gid, fs_info); + devfsd_notify_de (de, DEVFSD_NOTIFY_CREATE, inode->i_mode, + inode->i_uid, inode->i_gid, fs_info); return 0; } /* End Function devfs_symlink */ static int devfs_mkdir (struct inode *dir, struct dentry *dentry, int mode) { - int is_new; struct fs_info *fs_info; struct devfs_entry *parent, *de; struct inode *inode; mode = (mode & ~S_IFMT) | S_IFDIR; fs_info = dir->i_sb->u.generic_sbp; - /* First try to get the devfs entry for this directory */ parent = get_devfs_entry_from_vfs_inode (dir, TRUE); if (parent == NULL) return -ENOENT; - /* Try to reclaim an existing devfs entry, create if there isn't one */ - de = search_for_entry (parent, dentry->d_name.name, dentry->d_name.len, - FALSE, TRUE, &is_new, FALSE); - if (de == NULL) return -ENOMEM; - if (de->registered) + de = _devfs_alloc_dir (dentry->d_name.name, dentry->d_name.len); + if (!de) return -ENOMEM; + de->vfs_created = TRUE; + de->mode = mode; + if ( append_entry (parent, de) ) { - printk ("%s: mkdir(): existing entry\n", DEVFS_NAME); + devfs_put (de); + printk ("%s: mkdir(): existing devfs entry\n", DEVFS_NAME); return -EEXIST; } - de->hide = FALSE; - if (!S_ISDIR (de->mode) && !is_new) - { - /* Transmogrifying an old entry */ - de->u.dir.first = NULL; - de->u.dir.last = NULL; - } - de->mode = mode; - de->u.dir.num_removable = 0; de->inode.mode = mode; de->inode.uid = current->euid; de->inode.gid = current->egid; de->inode.atime = CURRENT_TIME; de->inode.mtime = CURRENT_TIME; de->inode.ctime = CURRENT_TIME; - de->registered = TRUE; if ( ( inode = get_vfs_inode (dir->i_sb, de, dentry) ) == NULL ) return -ENOMEM; #ifdef CONFIG_DEVFS_DEBUG @@ -2909,16 +3025,16 @@ DEVFS_NAME, de->inode.ino, inode, dentry); #endif d_instantiate (dentry, inode); - devfsd_notify_one (de, DEVFSD_NOTIFY_CREATE, inode->i_mode, - inode->i_uid, inode->i_gid, fs_info); + devfsd_notify_de (de, DEVFSD_NOTIFY_CREATE, inode->i_mode, + inode->i_uid, inode->i_gid, fs_info); return 0; } /* End Function devfs_mkdir */ static int devfs_rmdir (struct inode *dir, struct dentry *dentry) { - int has_children = FALSE; + int err = 0; + struct devfs_entry *de; struct fs_info *fs_info; - struct devfs_entry *de, *child; struct inode *inode = dentry->d_inode; if (dir->i_sb->u.generic_sbp != inode->i_sb->u.generic_sbp) return -EINVAL; @@ -2926,27 +3042,28 @@ de = get_devfs_entry_from_vfs_inode (inode, TRUE); if (de == NULL) return -ENOENT; if ( !S_ISDIR (de->mode) ) return -ENOTDIR; - for (child = de->u.dir.first; child != NULL; child = child->next) - { - if (child->registered) - { - has_children = TRUE; - break; - } - } - if (has_children) return -ENOTEMPTY; - devfsd_notify_one (de, DEVFSD_NOTIFY_DELETE, inode->i_mode, - inode->i_uid, inode->i_gid, fs_info); - de->hide = TRUE; - de->registered = FALSE; + if (!de->vfs_created) return -EPERM; + /* First ensure the directory is empty and will stay thay way */ + write_lock (&de->u.dir.lock); + de->u.dir.no_more_additions = TRUE; + if (de->u.dir.first) err = -ENOTEMPTY; + write_unlock (&de->u.dir.lock); + if (err) return err; + /* Now unhook the directory from it's parent */ + write_lock (&de->parent->u.dir.lock); + if ( !_devfs_unhook (de) ) err = -ENOENT; + write_unlock (&de->parent->u.dir.lock); + if (err) return err; + devfsd_notify_de (de, DEVFSD_NOTIFY_DELETE, inode->i_mode, + inode->i_uid, inode->i_gid, fs_info); free_dentries (de); + devfs_put (de); return 0; } /* End Function devfs_rmdir */ static int devfs_mknod (struct inode *dir, struct dentry *dentry, int mode, int rdev) { - int is_new; struct fs_info *fs_info; struct devfs_entry *parent, *de; struct inode *inode; @@ -2963,21 +3080,12 @@ DEVFS_NAME, txt, mode, rdev); } #endif - fs_info = dir->i_sb->u.generic_sbp; - /* First try to get the devfs entry for this directory */ parent = get_devfs_entry_from_vfs_inode (dir, TRUE); if (parent == NULL) return -ENOENT; - /* Try to reclaim an existing devfs entry, create if there isn't one */ - de = search_for_entry (parent, dentry->d_name.name, dentry->d_name.len, - FALSE, TRUE, &is_new, FALSE); - if (de == NULL) return -ENOMEM; - if (de->registered) - { - printk ("%s: mknod(): existing entry\n", DEVFS_NAME); - return -EEXIST; - } - de->info = NULL; + de = _devfs_alloc_entry (dentry->d_name.name, dentry->d_name.len); + if (!de) return -ENOMEM; + de->vfs_created = TRUE; de->mode = mode; if ( S_ISBLK (mode) || S_ISCHR (mode) ) { @@ -2995,14 +3103,18 @@ de->u.fifo.uid = current->euid; de->u.fifo.gid = current->egid; } - de->hide = FALSE; + if ( append_entry (parent, de) ) + { + devfs_put (de); + printk ("%s: mknod(): existing devfs entry\n", DEVFS_NAME); + return -EEXIST; + } de->inode.mode = mode; de->inode.uid = current->euid; de->inode.gid = current->egid; de->inode.atime = CURRENT_TIME; de->inode.mtime = CURRENT_TIME; de->inode.ctime = CURRENT_TIME; - de->registered = TRUE; if ( ( inode = get_vfs_inode (dir->i_sb, de, dentry) ) == NULL ) return -ENOMEM; #ifdef CONFIG_DEVFS_DEBUG @@ -3011,8 +3123,8 @@ DEVFS_NAME, de->inode.ino, inode, dentry); #endif d_instantiate (dentry, inode); - devfsd_notify_one (de, DEVFSD_NOTIFY_CREATE, inode->i_mode, - inode->i_uid, inode->i_gid, fs_info); + devfsd_notify_de (de, DEVFSD_NOTIFY_CREATE, inode->i_mode, + inode->i_uid, inode->i_gid, fs_info); return 0; } /* End Function devfs_mknod */ @@ -3023,10 +3135,7 @@ de = get_devfs_entry_from_vfs_inode (dentry->d_inode, TRUE); if (!de) return -ENODEV; - down_read (&symlink_rwsem); - err = de->registered ? vfs_readlink (dentry, buffer, buflen, - de->u.symlink.linkname) : -ENODEV; - up_read (&symlink_rwsem); + err = vfs_readlink (dentry, buffer, buflen, de->u.symlink.linkname); return err; } /* End Function devfs_readlink */ @@ -3034,25 +3143,10 @@ { int err; struct devfs_entry *de; - char *copy; de = get_devfs_entry_from_vfs_inode (dentry->d_inode, TRUE); if (!de) return -ENODEV; - down_read (&symlink_rwsem); - if (!de->registered) - { - up_read (&symlink_rwsem); - return -ENODEV; - } - copy = kmalloc (de->u.symlink.length + 1, GFP_KERNEL); - if (copy) memcpy (copy, de->u.symlink.linkname, de->u.symlink.length + 1); - up_read (&symlink_rwsem); - if (copy) - { - err = vfs_follow_link (nd, copy); - kfree (copy); - } - else err = -ENOMEM; + err = vfs_follow_link (nd, de->u.symlink.linkname); return err; } /* End Function devfs_follow_link */ @@ -3084,7 +3178,7 @@ { struct inode *root_inode = NULL; - if (get_root_entry () == NULL) goto out_no_root; + if (_devfs_get_root_entry () == NULL) goto out_no_root; atomic_set (&fs_info.devfsd_overrun_count, 0); init_waitqueue_head (&fs_info.devfsd_wait_queue); init_waitqueue_head (&fs_info.revalidate_wait_queue); @@ -3099,7 +3193,7 @@ sb->s_root = d_alloc_root (root_inode); if (!sb->s_root) goto out_no_root; #ifdef CONFIG_DEVFS_DEBUG - if (devfs_debug & DEBUG_DISABLED) + if (devfs_debug & DEBUG_S_READ) printk ("%s: read super, made devfs ptr: %p\n", DEVFS_NAME, sb->u.generic_sbp); #endif @@ -3182,6 +3276,7 @@ if (pos < 0) return pos; info->namelen = DEVFS_PATHLEN - pos - 1; if (info->mode == 0) info->mode = de->mode; + for (; de != NULL; de = de->parent) devfs_put (de); } devname_offset = info->devname - (char *) info; rpos = *ppos; From owner-devfs@oss.sgi.com Fri Nov 9 12:23:29 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fA9KNTj17169 for devfs-outgoing; Fri, 9 Nov 2001 12:23:29 -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 fA9KNR017165 for ; Fri, 9 Nov 2001 12:23:27 -0800 Received: from proski by fencepost.gnu.org with local (Exim 3.22 #1 (Debian)) id 162IBS-00034d-00 for ; Fri, 09 Nov 2001 15:23:26 -0500 Date: Fri, 9 Nov 2001 03:23:07 -0500 (EST) From: Pavel Roskin X-X-Sender: To: Subject: Download location for devfsd Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-devfs@oss.sgi.com Precedence: bulk Hello! File Documentation/filesystems/devfs/README from Linux-2.4.13-ac8 says that devfsd can be found at http://www.atnf.csiro.au/~rgooch/linux/ However, www.atnf.csiro.au (130.155.194.105) was down at the time when I started writing this message (approx. Fri Nov 9 08:15:00 UTC 2001). Now it's up, but the question remains - shouldn't the official site be http://www.kernel.org/pub/linux/daemons/devfsd/ ? It's mirrored worldwide. -- Regards, Pavel Roskin From owner-devfs@oss.sgi.com Fri Nov 9 12:33:32 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fA9KXWX17515 for devfs-outgoing; Fri, 9 Nov 2001 12:33:32 -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 fA9KXR017510 for ; Fri, 9 Nov 2001 12:33:27 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fA9KXM209483; Fri, 9 Nov 2001 13:33:22 -0700 Date: Fri, 9 Nov 2001 13:33:22 -0700 Message-Id: <200111092033.fA9KXM209483@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Pavel Roskin Cc: Subject: Re: Download location for devfsd In-Reply-To: References: Sender: owner-devfs@oss.sgi.com Precedence: bulk Pavel Roskin writes: > Hello! > > File Documentation/filesystems/devfs/README from Linux-2.4.13-ac8 says > that devfsd can be found at http://www.atnf.csiro.au/~rgooch/linux/ > > However, www.atnf.csiro.au (130.155.194.105) was down at the time > when I started writing this message (approx. Fri Nov 9 08:15:00 UTC > 2001). Temporary network failure. That site is well-managed, so it was probably a problem on one of the backbones. > Now it's up, but the question remains - shouldn't the official site be > http://www.kernel.org/pub/linux/daemons/devfsd/ ? It's mirrored > worldwide. I could do that, but I can't be bothered. I've already got a mirror site at: http://www.ras.ucalgary.ca/~rgooch/linux/docs/devfs.html and that should be sufficient. I've updated the document to reflect that, and the next time I send a patch to Linus, I'll try to remember to update Documentation/filesystems/devfs/README. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Fri Nov 9 13:13:41 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fA9LDfA18460 for devfs-outgoing; Fri, 9 Nov 2001 13:13:41 -0800 Received: from tsv.sws.net.au (tsv.sws.net.au [203.36.46.2]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fA9LDZ018455 for ; Fri, 9 Nov 2001 13:13:35 -0800 Received: from lyta.coker.com.au (localhost [127.0.0.1]) by tsv.sws.net.au (Postfix) with ESMTP id 8C377926FC for ; Sat, 10 Nov 2001 08:13:32 +1100 (EST) Received: from there (lyta [127.0.0.1]) by lyta.coker.com.au (Postfix) with SMTP id 4F88D18E5 for ; Fri, 9 Nov 2001 22:12:41 +0100 (CET) Content-Type: text/plain; charset="us-ascii" From: Russell Coker Reply-To: Russell Coker To: devfs@oss.sgi.com Subject: when do stdout, stdin, and stderr get created? Date: Fri, 9 Nov 2001 16:24:00 +0100 X-Mailer: KMail [version 1.3.2] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20011109211241.4F88D18E5@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk Currently on boot I see the following messages from devfsd: error lstat(2)ing: "stdin" No such file or directory error lstat(2)ing: "stdout" No such file or directory error lstat(2)ing: "stderr" No such file or directory Where are these links created? Why are they created in the early boot process? Why not just have devfsd create them (or one of the boot scripts)? -- http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/projects.html Projects I am working on http://www.coker.com.au/~russell/ My home page From owner-devfs@oss.sgi.com Fri Nov 9 14:16:05 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fA9MG5l19720 for devfs-outgoing; Fri, 9 Nov 2001 14:16: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 fA9MFx019717 for ; Fri, 9 Nov 2001 14:16:00 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fA9MFei10783; Fri, 9 Nov 2001 15:15:40 -0700 Date: Fri, 9 Nov 2001 15:15:40 -0700 Message-Id: <200111092215.fA9MFei10783@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Russell Coker Cc: devfs@oss.sgi.com Subject: Re: when do stdout, stdin, and stderr get created? In-Reply-To: <20011109211241.4F88D18E5@lyta.coker.com.au> References: <20011109211241.4F88D18E5@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk Russell Coker writes: > Currently on boot I see the following messages from devfsd: > error lstat(2)ing: "stdin" No such file or directory > error lstat(2)ing: "stdout" No such file or directory > error lstat(2)ing: "stderr" No such file or directory > > Where are these links created? Why are they created in the early > boot process? Why not just have devfsd create them (or one of the > boot scripts)? Those links are created by devfsd (as is "fd") early in it's initialisation phase. But the message is wrong, it's a call to stat(2) that is failing, not lstat(2). I don't get these messages. Hm. Is /proc mounted at this time? Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Fri Nov 9 14:39:08 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fA9Md8m20168 for devfs-outgoing; Fri, 9 Nov 2001 14:39:08 -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 fA9Mct020154 for ; Fri, 9 Nov 2001 14:38:55 -0800 Received: from proski by fencepost.gnu.org with local (Exim 3.22 #1 (Debian)) id 162KIY-00018X-00 for ; Fri, 09 Nov 2001 17:38:54 -0500 Date: Fri, 9 Nov 2001 05:38:36 -0500 (EST) From: Pavel Roskin X-X-Sender: To: Subject: Patch for GNUmakefile and rpm.spec Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-devfs@oss.sgi.com Precedence: bulk Hello! RedHat 7.2 doesn't have /usr/man - it keeps manuals in /usr/share/man. However, manuals are searched in /usr/man as well. Failure to install manuals causes config files not to be installed. It's generally a good idea to create directories before installing anything to them, especially since supporting PREFIX suggests that installing to a clean directory is supported. Also "install" should be preferred over "cp" whenever possible. There was no symbolic name for the directory holding devfsd.conf and modules.devfs (for the purpose of its creation), so I named it CONFDIR. Now it's possible to install devfs into an empty directory. I also made necessary updates to rpm.spec. No patches are needed anymore (and by the way, devfsd-install-path-patch was missing). "make install" can now be trusted (just the path for manuals has to be overridden). Also it's taken into account that the manual pages may be compressed - suffixes are allowed in their names. Finally, sanity checks for $RPM_BUILD_ROOT have been eliminated - I don't think that any recent version of rpm can "forget" to set it. Don't forget to change "version" in rpm.spec when releasing next versions. -- Regards, Pavel Roskin -------------------------------------------- --- GNUmakefile +++ GNUmakefile @@ -1,7 +1,8 @@ PREFIX = SBINDIR = $(PREFIX)/sbin MANDIR = $(PREFIX)/usr/man -CONFIG_FILE = $(PREFIX)/etc/devfsd.conf +CONFDIR = $(PREFIX)/etc +CONFIG_FILE = $(CONFDIR)/devfsd.conf DEFINES := nsl_libs := $(wildcard /lib/libnsl.so.*) @@ -30,13 +31,20 @@ echo "First remove the generic devfs entries from /etc/modules.conf"; exit 1; \ fi rm -f $(SBINDIR)/devfsd + install -d $(SBINDIR) install -s devfsd $(SBINDIR)/devfsd -rm -f $(MANDIR)/*/devfsd.* - cp -p devfsd.8 $(MANDIR)/man8 - cp -p devfsd.conf.5 $(MANDIR)/man5 - if [ ! -e $(CONFIG_FILE) ]; then cp -p devfsd.conf $(CONFIG_FILE); fi + install -d $(MANDIR)/man8 + install -m 644 devfsd.8 $(MANDIR)/man8 + install -d $(MANDIR)/man5 + install -m 644 devfsd.conf.5 $(MANDIR)/man5 + if [ ! -e $(CONFIG_FILE) ]; then \ + install -d $(CONFDIR); \ + install -m 644 devfsd.conf $(CONFDIR); \ + fi @echo "Installing /etc/modules.devfs" - @sed "s/DEVFSD-VERSION/`grep '#define DEVFSD_VERSION' version.h | cut -d'"' -f 2`/" modules.devfs > $(PREFIX)/etc/modules.devfs + @sed "s/DEVFSD-VERSION/`grep '#define DEVFSD_VERSION' version.h | \ + cut -d'"' -f 2`/" modules.devfs > $(CONFDIR)/modules.devfs clean: -rm -f *~ *.o *.orig *.rej --- rpm.spec +++ rpm.spec @@ -1,4 +1,4 @@ -%define version 1.3.12 +%define version 1.3.18 Name: devfsd Summary: devfs daemon for device name compatibility Version: %{version} @@ -7,7 +7,6 @@ Packager: William Stearns Group: System Environment/Daemons Source: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/daemons/devfsd-v%{version}.tar.gz -Patch0: devfsd-install-path-patch URL: http://www.atnf.csiro.au/~rgooch/linux/ BuildRoot: /tmp/devfsd-broot @@ -17,6 +16,11 @@ device entries in the Device Filesystem (devfs). %changelog +* Fri Nov 09 2001 Pavel Roskin +- Update source to 1.3.18. +- Eliminate patch - use fixed makefile instead. +- Allow compressed manuals and manuals in /usr/share/man. + * Sun Aug 20 2000 William Stearns - Update source to 1.3.10 - Remove ps check from rc.sysinit; /proc may not be mounted. @@ -33,7 +37,6 @@ %prep %setup -n devfsd -%patch0 -p1 %build @@ -41,31 +44,11 @@ %install -if [ "$RPM_BUILD_ROOT" = "/tmp/devfsd-broot" ]; then - rm -rf $RPM_BUILD_ROOT - - install -d $RPM_BUILD_ROOT/etc - #install -d $RPM_BUILD_ROOT/etc/rc.d/init.d - install -d $RPM_BUILD_ROOT/sbin - install -d $RPM_BUILD_ROOT/usr/man/man8 - install -d $RPM_BUILD_ROOT/usr/man/man5 - #make SBINDIR=$RPM_BUILD_ROOT/sbin CONFIG_FILE=$RPM_BUILD_ROOT/etc/devfsd.conf install - make PREFIX=$RPM_BUILD_ROOT install - cp -p devfsd.8 $RPM_BUILD_ROOT/usr/man/man8 - cp -p devfsd.conf.5 $RPM_BUILD_ROOT/usr/man/man5 -else - echo Invalid Build root - exit 1 -fi +make install PREFIX=$RPM_BUILD_ROOT MANDIR=$RPM_BUILD_ROOT/%{_mandir} %clean -if [ "$RPM_BUILD_ROOT" = "/tmp/devfsd-broot" ]; then - rm -rf $RPM_BUILD_ROOT -else - echo Invalid Build root - exit 1 -fi +rm -rf $RPM_BUILD_ROOT %post @@ -112,6 +95,6 @@ %attr(644,root,root) %config /etc/devfsd.conf %attr(644,root,root) %config /etc/modules.devfs %attr(755,root,root) /sbin/devfsd -%attr(644,root,root) /usr/man/man8/devfsd.8 -%attr(644,root,root) /usr/man/man5/devfsd.conf.5 +%attr(644,root,root) %{_mandir}/man8/devfsd.8* +%attr(644,root,root) %{_mandir}/man5/devfsd.conf.5* -------------------------------------------- From owner-devfs@oss.sgi.com Sat Nov 10 01:58:46 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAA9wko19120 for devfs-outgoing; Sat, 10 Nov 2001 01:58:46 -0800 Received: from tsv.sws.net.au (tsv.sws.net.au [203.36.46.2]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAA9wZ019117 for ; Sat, 10 Nov 2001 01:58:35 -0800 Received: from lyta.coker.com.au (localhost [127.0.0.1]) by tsv.sws.net.au (Postfix) with ESMTP id 6660A9260C; Sat, 10 Nov 2001 20:58:32 +1100 (EST) Received: from there (lyta [127.0.0.1]) by lyta.coker.com.au (Postfix) with SMTP id 41E481427; Sat, 10 Nov 2001 10:58:46 +0100 (CET) Content-Type: text/plain; charset="iso-8859-1" From: Russell Coker Reply-To: Russell Coker To: James Bromberger Subject: Re: DevFS, 2.4.12, RAID Date: Sat, 10 Nov 2001 10:58:45 +0100 X-Mailer: KMail [version 1.3.2] Cc: herbert@gondor.apana.org.au, devfs@oss.sgi.com References: <20011110133220.A4185@ucc.gu.uwa.edu.au> In-Reply-To: <20011110133220.A4185@ucc.gu.uwa.edu.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20011110095846.41E481427@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk On Sat, 10 Nov 2001 06:32, James Bromberger wrote: > I was just updating my RAID1 box to 2.4.12 from 2.4.8, and came across > some problems. DevFS was not creating the files > /dev/ide/host0/bus0/target0/lun0/part1, part2, ..etc... > > However, there was part 11, part 12, part 5, part 6. Doing a cfdisk > on /dev/ide/host0/bus0/target0/lun0/disc showed very clearly that > all original paritions were there (1-7, where 4 does't really > exist because of the logical/physical/extended parition situation). > > Anyway, when I went back to 2.4.8, these partN partitions returned. rjc@lyta:/tmp$ ls -l /dev/ide/host0/bus0/target0/lun0/ total 0 brw-rw---- 1 root disk 3, 0 Jan 1 1970 disc brw-rw---- 1 root disk 3, 1 Jan 1 1970 part1 brw-rw---- 1 root disk 3, 2 Jan 1 1970 part2 brw-rw---- 1 root disk 3, 3 Jan 1 1970 part3 brw-rw---- 1 root disk 3, 4 Jan 1 1970 part4 brw-rw---- 1 root disk 3, 5 Jan 1 1970 part5 brw-rw---- 1 root disk 3, 6 Jan 1 1970 part6 brw-rw---- 1 root disk 3, 7 Jan 1 1970 part7 rjc@lyta:/tmp$ uname -a Linux lyta 2.4.14-lsm #1 Tue Nov 6 16:16:39 CET 2001 i686 unknown rjc@lyta:/tmp$ It also worked for me on 2.4.9, 10, 12, and 13. > My guess is a bug in the devfs kernel code. But this is a hazard. It sounds most likely. I've CC'd this message to the devfs list, hopefully someone there will have some useful suggestions. > Anyway, one more question, and probably not really for you, but > /etc/raid/raidtab: should this contain devfs paths for the > raiddev and device lines, or tarditional /dev/ devices? My > understanding was to use traditional names, so the system can > still be started without devfs, but I don't think the raidstart > tool can handle this? Is this right? I use all devfs paths. But while in the change-over to devfs use old style paths. One problem I have found is that if converting from a RAID non-devfs system to devfs with initrd then the initrd creation scripts will want to use non-devfs paths (which won't work). There are two solutions. One is to do the following before installation of the kernel image (and creation of initrd): cd /dev mkdir md mv md1 md/1 The other is to create an initrd manually for the first boot of devfs. -- http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/projects.html Projects I am working on http://www.coker.com.au/~russell/ My home page From owner-devfs@oss.sgi.com Sat Nov 10 02:49:19 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAAAnJP19923 for devfs-outgoing; Sat, 10 Nov 2001 02:49:19 -0800 Received: from tsv.sws.net.au (tsv.sws.net.au [203.36.46.2]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAAAnF019919 for ; Sat, 10 Nov 2001 02:49:15 -0800 Received: from lyta.coker.com.au (localhost [127.0.0.1]) by tsv.sws.net.au (Postfix) with ESMTP id F2CBD9260C; Sat, 10 Nov 2001 21:49:12 +1100 (EST) Received: from there (lyta [127.0.0.1]) by lyta.coker.com.au (Postfix) with SMTP id 62A1F34DA9; Sat, 10 Nov 2001 11:49:30 +0100 (CET) Content-Type: text/plain; charset="iso-8859-1" From: Russell Coker Reply-To: Russell Coker To: Richard Gooch Subject: Re: when do stdout, stdin, and stderr get created? Date: Sat, 10 Nov 2001 11:49:30 +0100 X-Mailer: KMail [version 1.3.2] Cc: devfs@oss.sgi.com References: <20011109211241.4F88D18E5@lyta.coker.com.au> <200111092215.fA9MFei10783@vindaloo.ras.ucalgary.ca> In-Reply-To: <200111092215.fA9MFei10783@vindaloo.ras.ucalgary.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20011110104930.62A1F34DA9@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk On Fri, 9 Nov 2001 23:15, Richard Gooch wrote: > Russell Coker writes: > > Currently on boot I see the following messages from devfsd: > > error lstat(2)ing: "stdin" No such file or directory > > error lstat(2)ing: "stdout" No such file or directory > > error lstat(2)ing: "stderr" No such file or directory > > > > Where are these links created? Why are they created in the early > > boot process? Why not just have devfsd create them (or one of the > > boot scripts)? > > Those links are created by devfsd (as is "fd") early in it's > initialisation phase. But the message is wrong, it's a call to stat(2) > that is failing, not lstat(2). I don't get these messages. > > Hm. Is /proc mounted at this time? No. On Debian devfs is started before the "checkroot" script (which mounts /proc). I'm looking into getting this changed. -- http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/projects.html Projects I am working on http://www.coker.com.au/~russell/ My home page From owner-devfs@oss.sgi.com Sat Nov 10 09:11:33 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAAHBX926077 for devfs-outgoing; Sat, 10 Nov 2001 09:11:33 -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 fAAHBS026073 for ; Sat, 10 Nov 2001 09:11:28 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAAHBIq16761; Sat, 10 Nov 2001 10:11:18 -0700 Date: Sat, 10 Nov 2001 10:11:18 -0700 Message-Id: <200111101711.fAAHBIq16761@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Russell Coker Cc: devfs@oss.sgi.com Subject: Re: when do stdout, stdin, and stderr get created? In-Reply-To: <20011110104930.62A1F34DA9@lyta.coker.com.au> References: <20011109211241.4F88D18E5@lyta.coker.com.au> <200111092215.fA9MFei10783@vindaloo.ras.ucalgary.ca> <20011110104930.62A1F34DA9@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk Russell Coker writes: > On Fri, 9 Nov 2001 23:15, Richard Gooch wrote: > > Russell Coker writes: > > > Currently on boot I see the following messages from devfsd: > > > error lstat(2)ing: "stdin" No such file or directory > > > error lstat(2)ing: "stdout" No such file or directory > > > error lstat(2)ing: "stderr" No such file or directory > > > > > > Where are these links created? Why are they created in the early > > > boot process? Why not just have devfsd create them (or one of the > > > boot scripts)? > > > > Those links are created by devfsd (as is "fd") early in it's > > initialisation phase. But the message is wrong, it's a call to stat(2) > > that is failing, not lstat(2). I don't get these messages. > > > > Hm. Is /proc mounted at this time? > > No. On Debian devfs is started before the "checkroot" script (which > mounts /proc). > > I'm looking into getting this changed. Well, this shouldn't be necessary. I've already fixed the message to reflect that it's stat(2) that's failing and not lstat(2). I'm considering making the PERMISSIONS action ignore symlinks. Right now, you can change permissions by going through a symlink. That would no longer be possible. For example: REGISTER discs/disc.*/disc PERMISSIONS 0.0 rw-r----- would no longer change the permissions of all whole-disc entries. However, you could get the same effect with: REGISTER .*/disc PERMISSIONS 0.0 rw-r----- since no non-disc driver should create a "disc" leaf node. Otherwise, you'd need something like: REGISTER scsi/.*/disc PERMISSIONS 0.0 rw-r----- REGISTER ide/.*/disc PERMISSIONS 0.0 rw-r----- Comments? BTW: what config line do you have that wants to change the permissions of "stdin", "stdout" and "stderr" anyway? Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Sat Nov 10 09:49:58 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAAHnwg26498 for devfs-outgoing; Sat, 10 Nov 2001 09:49:58 -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 fAAHnp026495 for ; Sat, 10 Nov 2001 09:49:51 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAAHnhg17045; Sat, 10 Nov 2001 10:49:43 -0700 Date: Sat, 10 Nov 2001 10:49:43 -0700 Message-Id: <200111101749.fAAHnhg17045@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Russell Coker Cc: James Bromberger , herbert@gondor.apana.org.au, devfs@oss.sgi.com Subject: Re: DevFS, 2.4.12, RAID In-Reply-To: <20011110095846.41E481427@lyta.coker.com.au> References: <20011110133220.A4185@ucc.gu.uwa.edu.au> <20011110095846.41E481427@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk Russell Coker writes: > On Sat, 10 Nov 2001 06:32, James Bromberger wrote: > > I was just updating my RAID1 box to 2.4.12 from 2.4.8, and came across > > some problems. DevFS was not creating the files > > /dev/ide/host0/bus0/target0/lun0/part1, part2, ..etc... > > > > However, there was part 11, part 12, part 5, part 6. Doing a cfdisk > > on /dev/ide/host0/bus0/target0/lun0/disc showed very clearly that > > all original paritions were there (1-7, where 4 does't really > > exist because of the logical/physical/extended parition situation). > > > > Anyway, when I went back to 2.4.8, these partN partitions returned. > > rjc@lyta:/tmp$ ls -l /dev/ide/host0/bus0/target0/lun0/ > total 0 > brw-rw---- 1 root disk 3, 0 Jan 1 1970 disc > brw-rw---- 1 root disk 3, 1 Jan 1 1970 part1 > brw-rw---- 1 root disk 3, 2 Jan 1 1970 part2 > brw-rw---- 1 root disk 3, 3 Jan 1 1970 part3 > brw-rw---- 1 root disk 3, 4 Jan 1 1970 part4 > brw-rw---- 1 root disk 3, 5 Jan 1 1970 part5 > brw-rw---- 1 root disk 3, 6 Jan 1 1970 part6 > brw-rw---- 1 root disk 3, 7 Jan 1 1970 part7 > rjc@lyta:/tmp$ uname -a > Linux lyta 2.4.14-lsm #1 Tue Nov 6 16:16:39 CET 2001 i686 unknown > rjc@lyta:/tmp$ > > It also worked for me on 2.4.9, 10, 12, and 13. > > > My guess is a bug in the devfs kernel code. But this is a hazard. > > It sounds most likely. I've CC'd this message to the devfs list, > hopefully someone there will have some useful suggestions. Recently there was a bug introduced in the partition handling code. Try a more recent kernel (2.4.14 or later) and see if the problem persists. If it does, then you'll need to start putting in debugging printk()'s to narrow down the problem. I'm concentrating on the new devfs core, and would prefer to keep focussed on that. BTW, Russell: I haven't seen a response from you yet to my most recent reply to the "annoying symlink messages" thread from earlier this week. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Sat Nov 10 10:41:45 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAAIfjj27414 for devfs-outgoing; Sat, 10 Nov 2001 10:41:45 -0800 Received: from ucc.gu.uwa.edu.au (IDENT:omailes@mooneye.ucc.gu.uwa.edu.au [130.95.13.9]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAAIfa027409 for ; Sat, 10 Nov 2001 10:41:37 -0800 Received: from mussel.ucc.gu.uwa.edu.au (root@mussel.ucc.gu.uwa.edu.au [130.95.13.18]) by ucc.gu.uwa.edu.au (8.12.0/8.12.0/Debian -5) with ESMTP id fAAIfEVM013988; Sun, 11 Nov 2001 02:41:14 +0800 Received: from mussel.ucc.gu.uwa.edu.au (james@localhost [127.0.0.1]) by mussel.ucc.gu.uwa.edu.au (8.12.1/8.12.1/Debian -2) with ESMTP id fAAIfEZi006457; Sun, 11 Nov 2001 02:41:14 +0800 Received: (from james@localhost) by mussel.ucc.gu.uwa.edu.au (8.12.1/8.12.1/Debian -2) id fAAIfDng006455; Sun, 11 Nov 2001 02:41:13 +0800 Date: Sun, 11 Nov 2001 02:41:13 +0800 From: James Bromberger To: Richard Gooch Cc: Russell Coker , herbert@gondor.apana.org.au, devfs@oss.sgi.com Subject: Re: DevFS, 2.4.12, RAID Message-ID: <20011111024113.B6371@ucc.gu.uwa.edu.au> References: <20011110133220.A4185@ucc.gu.uwa.edu.au> <20011110095846.41E481427@lyta.coker.com.au> <200111101749.fAAHnhg17045@vindaloo.ras.ucalgary.ca> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s/l3CgOIzMHHjg/5" Content-Disposition: inline In-Reply-To: <200111101749.fAAHnhg17045@vindaloo.ras.ucalgary.ca> User-Agent: Mutt/1.3.23i X-GPG-Fingerprint: 3F2C F8FD B2D5 AA35 C81A F914 A5F2 7028 0917 A9E4 Sender: owner-devfs@oss.sgi.com Precedence: bulk --s/l3CgOIzMHHjg/5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 10, 2001 at 10:49:43AM -0700, Richard Gooch wrote: > Russell Coker writes: > Recently there was a bug introduced in the partition handling > code. Try a more recent kernel (2.4.14 or later) and see if the > problem persists. If it does, then you'll need to start putting in > debugging printk()'s to narrow down the problem. I'm concentrating on > the new devfs core, and would prefer to keep focussed on that. Indeed. Thanks for the response, Richard. I'll wait for Herbert's (CC'ed)= =20 packaged 2.4.14 to hit the Debian testing distribution two weeks now=20 (I see them sitting there in incoming right now), and try again then. I=20 had seen some points in the -ac and Linus changelogs recently; I guess=20 that's what I hit. I don't want to be too rash with this system in question as its a=20 production SMB fileserver/Samba PDC/Mail server/etc. I should turn my=20 own dev box into a similar config I guess to play with it... Ta for the help, all, James www.james.rcpt.to/programs/debian/raid1/ --=20 James Bromberger www.james.rcpt.to Australian Debian Conference: http://www.linux.org.au/conf/debiancon.html Remainder moved to http://www.james.rcpt.to/james/sig.html --s/l3CgOIzMHHjg/5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE77XTJpfJwKAkXqeQRApyQAKDGbuqVw652OCVOJZ7DhR/HgUxnBACeJBpS 8FofTkN0LqLs+OnB8tOM8O4= =jjxL -----END PGP SIGNATURE----- --s/l3CgOIzMHHjg/5-- From owner-devfs@oss.sgi.com Sat Nov 10 17:27:09 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAB1R9u02239 for devfs-outgoing; Sat, 10 Nov 2001 17:27:09 -0800 Received: from tsv.sws.net.au (tsv.sws.net.au [203.36.46.2]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAB1R2002235 for ; Sat, 10 Nov 2001 17:27:02 -0800 Received: from lyta.coker.com.au (localhost [127.0.0.1]) by tsv.sws.net.au (Postfix) with ESMTP id C7D739260C; Sun, 11 Nov 2001 12:26:58 +1100 (EST) Received: from there (lyta [127.0.0.1]) by lyta.coker.com.au (Postfix) with SMTP id EE94735A01A; Sun, 11 Nov 2001 02:27:23 +0100 (CET) Content-Type: text/plain; charset="iso-8859-1" From: Russell Coker Reply-To: Russell Coker To: Richard Gooch Subject: Re: when do stdout, stdin, and stderr get created? Date: Sun, 11 Nov 2001 02:27:23 +0100 X-Mailer: KMail [version 1.3.2] Cc: devfs@oss.sgi.com References: <20011109211241.4F88D18E5@lyta.coker.com.au> <20011110104930.62A1F34DA9@lyta.coker.com.au> <200111101711.fAAHBIq16761@vindaloo.ras.ucalgary.ca> In-Reply-To: <200111101711.fAAHBIq16761@vindaloo.ras.ucalgary.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20011111012723.EE94735A01A@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk On Sat, 10 Nov 2001 18:11, Richard Gooch wrote: > > > > Currently on boot I see the following messages from devfsd: > > > > error lstat(2)ing: "stdin" No such file or directory > > > > error lstat(2)ing: "stdout" No such file or directory > > > > error lstat(2)ing: "stderr" No such file or directory > > > > > > > > Where are these links created? Why are they created in the early > > > > boot process? Why not just have devfsd create them (or one of the > > > > boot scripts)? > > > > > > Those links are created by devfsd (as is "fd") early in it's > > > initialisation phase. But the message is wrong, it's a call to stat(2) > > > that is failing, not lstat(2). I don't get these messages. > > > > > > Hm. Is /proc mounted at this time? > > > > No. On Debian devfs is started before the "checkroot" script (which > > mounts /proc). > > > > I'm looking into getting this changed. > > Well, this shouldn't be necessary. I've already fixed the message to > reflect that it's stat(2) that's failing and not lstat(2). I'm > considering making the PERMISSIONS action ignore symlinks. Right now, > you can change permissions by going through a symlink. That would no > longer be possible. For example: > REGISTER discs/disc.*/disc PERMISSIONS 0.0 rw-r----- > > would no longer change the permissions of all whole-disc > entries. However, you could get the same effect with: > REGISTER .*/disc PERMISSIONS 0.0 rw-r----- > > since no non-disc driver should create a "disc" leaf node. Otherwise, > you'd need something like: > REGISTER scsi/.*/disc PERMISSIONS 0.0 rw-r----- > REGISTER ide/.*/disc PERMISSIONS 0.0 rw-r----- > > Comments? This sounds good. Now can I count on all whole-disk entries to match in /disc$ and all partitions to match /part[0-9]+$ and nothing to give a false match? Currently I have separate entries for IDE and SCSI and have been contemplating adding new entries for RAID controllers etc. > BTW: what config line do you have that wants to change the permissions > of "stdin", "stdout" and "stderr" anyway? Nothing any more. Once I made a mistake in a config file which matched ^st as SCSI tapes and changed stdin/stdout/stderr to mode 600 which for some reason I could not determine resulted in /dev getting mode 600 and the system being mostly unusable. The strange thing was that it didn't happen at initial start, only on signal 1. -- http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/projects.html Projects I am working on http://www.coker.com.au/~russell/ My home page From owner-devfs@oss.sgi.com Sat Nov 10 18:19:28 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAB2JSv03340 for devfs-outgoing; Sat, 10 Nov 2001 18:19: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 fAB2JM003337 for ; Sat, 10 Nov 2001 18:19:22 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAB2JIN22398; Sat, 10 Nov 2001 19:19:18 -0700 Date: Sat, 10 Nov 2001 19:19:18 -0700 Message-Id: <200111110219.fAB2JIN22398@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Russell Coker Cc: devfs@oss.sgi.com Subject: Re: when do stdout, stdin, and stderr get created? In-Reply-To: <20011111012723.EE94735A01A@lyta.coker.com.au> References: <20011109211241.4F88D18E5@lyta.coker.com.au> <20011110104930.62A1F34DA9@lyta.coker.com.au> <200111101711.fAAHBIq16761@vindaloo.ras.ucalgary.ca> <20011111012723.EE94735A01A@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk Russell Coker writes: > On Sat, 10 Nov 2001 18:11, Richard Gooch wrote: > > Well, this shouldn't be necessary. I've already fixed the message to > > reflect that it's stat(2) that's failing and not lstat(2). I'm > > considering making the PERMISSIONS action ignore symlinks. Right now, > > you can change permissions by going through a symlink. That would no > > longer be possible. For example: > > REGISTER discs/disc.*/disc PERMISSIONS 0.0 rw-r----- > > > > would no longer change the permissions of all whole-disc > > entries. However, you could get the same effect with: > > REGISTER .*/disc PERMISSIONS 0.0 rw-r----- > > > > since no non-disc driver should create a "disc" leaf node. Otherwise, > > you'd need something like: > > REGISTER scsi/.*/disc PERMISSIONS 0.0 rw-r----- > > REGISTER ide/.*/disc PERMISSIONS 0.0 rw-r----- > > > > Comments? > > This sounds good. Now can I count on all whole-disk entries to > match in /disc$ and all partitions to match /part[0-9]+$ and nothing > to give a false match? Currently I have separate entries for IDE > and SCSI and have been contemplating adding new entries for RAID > controllers etc. Well, I imagine you're pretty safe in relying on "disc" not being used by anything/anyone else :-) I would hope that no other driver wants to use part%d for some other use. More importantly, I hope that no other driver just goes ahead and does it. An alternative is to add a "nowarn" option to the action. That way, it will be silent on dangling symlink. There is a reason for favouring this approach over ignoring symlinks in the PERMISSIONS action. By ignoring symlinks, a certain flexibility is lost. The scheme I mentioned above will work nicely for disc devices, and is probably OK for CD-ROMs as well. But consider tape devices. The leaf nodes are not as well defined there, which is due to the definition of a variety of access modes. This variety is likely to increase as new devices are developed. So, for tapes, it is much easier to use the /dev/tapes hierarchy, which in turn means that ignoring symlinks in the PERMISSIONS action would be detrimental. Which is why I said I'm just considering it, rather than "I've done it" :-) > > BTW: what config line do you have that wants to change the permissions > > of "stdin", "stdout" and "stderr" anyway? > > Nothing any more. > > Once I made a mistake in a config file which matched ^st as SCSI > tapes and changed stdin/stdout/stderr to mode 600 which for some > reason I could not determine resulted in /dev getting mode 600 and > the system being mostly unusable. The strange thing was that it > didn't happen at initial start, only on signal 1. Curious. Feel free to strace devfsd to narrow down this "effect"... Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Mon Nov 12 03:17:15 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fACBHFL16933 for devfs-outgoing; Mon, 12 Nov 2001 03:17:15 -0800 Received: from achiel (achiel.interconnect.nl [212.83.192.60]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fACBHB016930 for ; Mon, 12 Nov 2001 03:17:12 -0800 Received: from dcdds.nl (unverified [212.83.217.17]) by achiel (Rockliffe SMTPRA 4.5.6) with ESMTP id for ; Mon, 12 Nov 2001 12:17:10 +0100 Received: from [192.168.6.158] (helo=ws105) by dcdds.nl with smtp (Exim 3.03 #1) id 163ElB-0003DX-00 for devfs@oss.sgi.com; Mon, 12 Nov 2001 11:56:13 +0100 From: "Bjorn Boxstart" To: Subject: Suse 7.2 and devfs Date: Mon, 12 Nov 2001 11:59:08 +0100 Message-ID: <000501c16b69$0e687770$9e06a8c0@ws105> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-devfs@oss.sgi.com Precedence: bulk Hello All, I'm trying to use devfs with suse linux 7.2. However, I have a problem with the file to change to load devfsd at boot time. The files mentioned in the Devfs readme are not available on my system. Does anybody know which files to change to get things working with Suse 7.2. The reason for me to try using devfs is that I want to be able to use more than 16 usb printers on my linux system. Can anybody tell me if devfs _will_ help me solving this problem. I was quite convinced by the readme file that it would. Please forgive me if I am asking silly questions, because I'm quite new to devfs (and also not a linux guru). Thanks in advance, Bjorn Boxstart Data Concept Documentation Services Europe BV Industrieweg 6c 4104 AR Culemborg P.O. Box 37 4100 AA Culemborg The Netherlands Tel +31 (0) 345 510 879 Fax +31 (0) 345 510 867 Website www.dcdds.nl From owner-devfs@oss.sgi.com Tue Nov 13 18:30:12 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAE2UCM00385 for devfs-outgoing; Tue, 13 Nov 2001 18:30:12 -0800 Received: from poontang.schulte.org (poontang.schulte.org [209.134.156.197]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAE2UA000382 for ; Tue, 13 Nov 2001 18:30:10 -0800 Received: from pinnacle.schulte.org (pinnacle.schulte.org [209.134.156.220]) by poontang.schulte.org (Postfix) with ESMTP id B8978D1431 for ; Tue, 13 Nov 2001 20:30:09 -0600 (CST) Received: (from liver@localhost) by pinnacle.schulte.org (8.11.6/8.11.6) id fAE2U9u69504 for devfs@oss.sgi.com; Tue, 13 Nov 2001 20:30:09 -0600 (CST) (envelope-from liver) Date: Tue, 13 Nov 2001 20:30:09 -0600 From: Anthony Sofia To: devfs@oss.sgi.com Subject: devfs proc interface Message-ID: <20011113203009.A69484@dryhump.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-devfs@oss.sgi.com Precedence: bulk I was wondering if there was interest in using a proc ineterface for persistent permissions for a devfs filesystem. I have a patch for it that i need to test a little more, but i could post it to the list shortly, it is my first dive into kernel programming. Anthony Sofia -- anthony@dryhump.net From owner-devfs@oss.sgi.com Tue Nov 13 18:42:34 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAE2gYl00592 for devfs-outgoing; Tue, 13 Nov 2001 18:42:34 -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 fAE2gW000584 for ; Tue, 13 Nov 2001 18:42:32 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAE2gPe00563; Tue, 13 Nov 2001 19:42:25 -0700 Date: Tue, 13 Nov 2001 19:42:25 -0700 Message-Id: <200111140242.fAE2gPe00563@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Anthony Sofia Cc: devfs@oss.sgi.com Subject: Re: devfs proc interface In-Reply-To: <20011113203009.A69484@dryhump.net> References: <20011113203009.A69484@dryhump.net> Sender: owner-devfs@oss.sgi.com Precedence: bulk Anthony Sofia writes: > I was wondering if there was interest in using a proc ineterface for > persistent permissions for a devfs filesystem. I have a patch for it > that i need to test a little more, but i could post it to the list > shortly, it is my first dive into kernel programming. ??? There already is a mechanism for permissions persistence in devfs. What do you want another mechanism for? Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Wed Nov 14 15:05:27 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAEN5RY06872 for devfs-outgoing; Wed, 14 Nov 2001 15:05: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 fAEN5K006867 for ; Wed, 14 Nov 2001 15:05:20 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAEN1fD10739; Wed, 14 Nov 2001 16:01:41 -0700 Date: Wed, 14 Nov 2001 16:01:41 -0700 Message-Id: <200111142301.fAEN1fD10739@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v197 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 197 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.15-pre4. Highlights of this release: - First release of new locking code for devfs core (v1.0) - Fixed bug in drivers/cdrom/cdrom.c Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Nov 15 23:39:14 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAG7dEl19766 for devfs-outgoing; Thu, 15 Nov 2001 23:39:14 -0800 Received: from sgi.com (sgi.SGI.COM [192.48.153.1]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAG7d5019760 for ; Thu, 15 Nov 2001 23:39:05 -0800 Received: from achiel.interconnect.nl (achiel.interconnect.nl [212.83.192.60]) by sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam: SGI does not authorize the use of its proprietary systems or networks for unsolicited or bulk email from the Internet.) via ESMTP id XAA03380 for ; Thu, 15 Nov 2001 23:39:02 -0800 (PST) mail_from (boxstart@dcdds.nl) Received: from dcdds.nl (unverified [212.83.217.17]) by achiel.interconnect.nl (Rockliffe SMTPRA 4.5.6) with ESMTP id for ; Fri, 16 Nov 2001 08:38:58 +0100 Received: from [192.168.6.158] (helo=ws105) by dcdds.nl with smtp (Exim 3.03 #1) id 164dQb-0001zK-00 for devfs@oss.sgi.com; Fri, 16 Nov 2001 08:28:45 +0100 From: "Bjorn Boxstart" To: Subject: Devfs and Minors Date: Fri, 16 Nov 2001 08:31:42 +0100 Message-ID: <000101c16e70$bdaa1f40$9e06a8c0@ws105> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal Sender: owner-devfs@oss.sgi.com Precedence: bulk Hello All, According to the readme that comes with devfs, Devfs should solve the problem of having minors and majors. I thought this would help me with using over 16 USB printers at once. After installation however, I still can use only 16 printers. Can anybody clarify for me what I misunderstood..... Thanks in Advance rg. Bjorn Data Concept Documentation Services Europe BV Industrieweg 6c 4104 AR Culemborg P.O. Box 37 4100 AA Culemborg The Netherlands Tel +31 (0) 345 510 879 Fax +31 (0) 345 510 867 Website www.dcdds.nl From owner-devfs@oss.sgi.com Thu Nov 15 23:45:59 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAG7jx719958 for devfs-outgoing; Thu, 15 Nov 2001 23:45:59 -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 fAG7ju019955 for ; Thu, 15 Nov 2001 23:45:56 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAG7juD30349; Fri, 16 Nov 2001 00:45:56 -0700 Date: Fri, 16 Nov 2001 00:45:56 -0700 Message-Id: <200111160745.fAG7juD30349@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: "Bjorn Boxstart" Cc: Subject: Re: Devfs and Minors In-Reply-To: <000101c16e70$bdaa1f40$9e06a8c0@ws105> References: <000101c16e70$bdaa1f40$9e06a8c0@ws105> Sender: owner-devfs@oss.sgi.com Precedence: bulk Bjorn Boxstart writes: > According to the readme that comes with devfs, Devfs should solve > the problem of having minors and majors. I thought this would help > me with using over 16 USB printers at once. After installation > however, I still can use only 16 printers. Can anybody clarify for > me what I misunderstood..... Devfs provides a mechanism for drivers to create device nodes without having to worry about device numbers. But it's still up to the drivers to make use of that facility. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Fri Nov 16 04:20:06 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAGCK6U26381 for devfs-outgoing; Fri, 16 Nov 2001 04:20:06 -0800 Received: from sabi.co.UK (sabi.claranet.co.uk [212.126.138.20]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAGCJwg26374 for ; Fri, 16 Nov 2001 04:19:59 -0800 Received: from localhost ([127.0.0.1] helo=home.sabi.co.UK ident=piercarl) by sabi.co.UK with esmtp (Exim 3.16 #1) id 164huW-0005Xo-00; Fri, 16 Nov 2001 12:15:56 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15349.891.971146.271789@home.sabi.co.UK> Date: Fri, 16 Nov 2001 12:15:55 +0000 X-Face: SMJE]JPYVBO-9UR%/8d'mG.F!@.,l@c[f'[%S8'BZIcbQc3/">GrXDwb#;fTRGNmHr^JFbS AptvwWc,0+z+~p~"Gdr4H$(|N(yF(wwCM2bW0~U?HPEE^fkPGx^u[*[yV.gyB!hDOli}EF[\cW*SH< GG"+i\3#fp@@EeWZWBv;]LA5n1pS2VO%Vv[yH?kY'lEWr30WfIU?%>&spRGFL}{`bj1TaD^l/"[msn (/TH#THs{Hpj>)]f> Cc: Subject: Re: Devfs and Minors In-Reply-To: <000101c16e70$bdaa1f40$9e06a8c0@ws105> References: <000101c16e70$bdaa1f40$9e06a8c0@ws105> X-Mailer: VM 6.95 under 21.4 (patch 4) "Artificial Intelligence" XEmacs Lucid Reply-To: pg_mh@sabi.Clara.co.UK (Piercarlo Grandi) From: pg_mh@sabi.Clara.co.UK (Piercarlo Grandi) X-Disclaimer: This message contains only personal opinions Sender: owner-devfs@oss.sgi.com Precedence: bulk >>> On Fri, 16 Nov 2001 08:31:42 +0100, "Bjorn Boxstart" >>> said: boxstart> Hello All, According to the readme that comes with devfs, boxstart> Devfs should solve the problem of having minors and majors. Ah, it does, it does... boxstart> I thought this would help me with using over 16 USB printers boxstart> at once. After installation however, I still can use only 16 boxstart> printers. Can anybody clarify for me what I misunderstood..... Well, how the minor device number (device id) is interepreted is up to the driver, and how big its internal tables are, 'devfs' cannot work around that. If the driver has a compiled in number of devices, like in your case in 'drivers/usb/printer.c': #define USBLP_MINORS 16 static struct usblp *usblp_table[USBLP_MINORS]; that's how the driver is written. If you want more than 16 printers you have to change that definition above and recompile the driver, there is no way around that. Most drivers don't support an arbitrary number of devices, they have statically allocated device state tables, like the USB printer driver. 'devfs' solves the two big problems with static allocation of '/dev/' entries (not of device state entries in the driver) to major and minor numbers: * Static allocation of major device numbers (driver id). * Static definition of an '/dev/' entry for every possible minor number (device id). Since '/dev/' entries are created dynamically, based on what the driver itself tells 'devfs', their major numbers need not be known in advance, as only the drivers actually present will trigger the creation of '/dev/' entries, and only the number of entries corresponding to the actual number of minor numbers defined by the driver is created. In your case, it means that no matter what number you put in the definition of 'USBLP_MINORS', the right number of '/dev/printers/' entries will be created automagically. From owner-devfs@oss.sgi.com Fri Nov 16 07:39:00 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAGFd0B31694 for devfs-outgoing; Fri, 16 Nov 2001 07:39: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 fAGFcng31690 for ; Fri, 16 Nov 2001 07:38:49 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAGFcqI00801; Fri, 16 Nov 2001 08:38:52 -0700 Date: Fri, 16 Nov 2001 08:38:52 -0700 Message-Id: <200111161538.fAGFcqI00801@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: pg_mh@sabi.Clara.co.UK (Piercarlo Grandi) Cc: Bjorn Boxstart , Subject: Re: Devfs and Minors In-Reply-To: <15349.891.971146.271789@home.sabi.co.UK> References: <000101c16e70$bdaa1f40$9e06a8c0@ws105> <15349.891.971146.271789@home.sabi.co.UK> Sender: owner-devfs@oss.sgi.com Precedence: bulk Piercarlo Grandi writes: > >>> On Fri, 16 Nov 2001 08:31:42 +0100, "Bjorn Boxstart" > >>> said: > > boxstart> Hello All, According to the readme that comes with devfs, > boxstart> Devfs should solve the problem of having minors and majors. > > Ah, it does, it does... > > boxstart> I thought this would help me with using over 16 USB printers > boxstart> at once. After installation however, I still can use only 16 > boxstart> printers. Can anybody clarify for me what I misunderstood..... > > Well, how the minor device number (device id) is interepreted is up to > the driver, and how big its internal tables are, 'devfs' cannot work > around that. > > If the driver has a compiled in number of devices, like in your case in > 'drivers/usb/printer.c': > > #define USBLP_MINORS 16 > static struct usblp *usblp_table[USBLP_MINORS]; > > that's how the driver is written. If you want more than 16 printers you > have to change that definition above and recompile the driver, there is > no way around that. > > Most drivers don't support an arbitrary number of devices, they have > statically allocated device state tables, like the USB printer driver. > > 'devfs' solves the two big problems with static allocation of '/dev/' > entries (not of device state entries in the driver) to major and minor > numbers: > > * Static allocation of major device numbers (driver id). > > * Static definition of an '/dev/' entry for every possible minor number > (device id). Another thing that devfs does is make writing of completely dynamic device drivers much easier. It's easy to use a linked list of device entries, rather than a static table. Each devfs entry will correspond to a device instance structure, with the two pointing to each other. You put the device instance structures in a linked list so that at module unload time, you can loop through and free everything. It'd be nice if someone did that for the USB printer driver. You can even do it in a way that keeps it compatible with old-style (non-devfs) device nodes. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Fri Nov 16 15:15:18 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAGNFIe31070 for devfs-outgoing; Fri, 16 Nov 2001 15:15:18 -0800 Received: from corwin.ambre.meuh.eu.org (IDENT:root@Mix-LeMans-207-175.abo.wanadoo.fr [193.249.30.175]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAGNEbg31015 for ; Fri, 16 Nov 2001 15:14:38 -0800 Received: (from meuh@localhost) by corwin.ambre.meuh.eu.org (8.8.7/8.8.7) id AAA05838; Sat, 17 Nov 2001 00:09:07 +0100 Date: Sat, 17 Nov 2001 00:09:07 +0100 Message-Id: <200111162309.AAA05838@corwin.ambre.meuh.eu.org> From: Yann Droneaud To: devfs@oss.sgi.com Subject: [PATCH] configuration for modprobe Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, here is a quite big patch against devfsd v1.3.18. This enable user to select which modprobe to use, This also let the user specify arguments to pass to it. The config options could be put in devfsd.conf or on command line. Command line options have a higher priority. Also some Makefile little tweaks This work perfectly for me (with a patch against modprobe to make it use syslog(), the patch was sent to the modutils team). Feel free to use it as is, or make any modification to my code. -- Yann Droneaud ================ patch-devfsd-meuh-modprobe-arguments ========================= diff -ur devfsd-1.3.18/GNUmakefile devfsd-1.3.18-meuh/GNUmakefile --- devfsd-1.3.18/GNUmakefile Sat Aug 18 19:50:39 2001 +++ devfsd-1.3.18-meuh/GNUmakefile Fri Nov 16 22:12:20 2001 @@ -16,14 +16,16 @@ OBJECTS = devfsd.o expression.o compat_name.o +CC = gcc +CFLAGS = -g -O2 -W -Wall +CFLAGS += -I. ifdef KERNEL_DIR -CFLAGS = -O2 -I. -I$(KERNEL_DIR)/include -Wall $(CEXTRAS) $(DEFINES) -else -CFLAGS = -O2 -I. -Wall $(CEXTRAS) $(DEFINES) +CFLAGS += -I$(KERNEL_DIR)/include endif +CFLAGS += $(CEXTRAS) $(DEFINES) devfsd: $(OBJECTS) - cc -O2 -o devfsd $(OBJECTS) $(LDFLAGS) -export-dynamic -ldl + $(CC) $(CFLAGS) -o devfsd $(OBJECTS) $(LDFLAGS) -export-dynamic -ldl install: devfsd @if fgrep -q "Generic section: do not change" /etc/modules.conf ; then\ diff -ur devfsd-1.3.18/devfsd.c devfsd-1.3.18-meuh/devfsd.c --- devfsd-1.3.18/devfsd.c Mon Aug 20 02:12:21 2001 +++ devfsd-1.3.18-meuh/devfsd.c Fri Nov 16 23:36:44 2001 @@ -206,11 +206,13 @@ Updated by Richard Gooch 18-AUG-2001: Dynamically load libnsl at run-time as needed, rather than linking. Based on patch from Adam J. Richter. - Last updated by Richard Gooch 19-AUG-2001: Switched to stat(2) in + Updated by Richard Gooch 19-AUG-2001: Switched to stat(2) in to avoid harmless false positives. Return 0 instead of exiting if passwd or group entry not found in database. Do not exit in if fork(2) fails. + Last updated by Yann Droneaud 16-NOV-2001: support for + modprobe configuration (which modprobe use and with what parameters) */ #define _GNU_SOURCE @@ -247,8 +249,10 @@ # define RTLD_DEFAULT RTLD_NEXT #endif +#define MODPROBE "/sbin/modprobe" #define CONFIG_FILE "/etc/devfsd.conf" -#define MAX_ARGS (6 + 1) +#define MAX_ARGS (6 + 1) +#define MAX_ARGV_ARGS 16 /* number of arguments passed to modprobe */ #define MAX_SUBEXPR 10 /* Update only after changing code to reflect new protocol */ @@ -287,7 +291,7 @@ struct execute_type { - char *argv[MAX_ARGS + 1]; /* argv[0] must always be the programme */ + char *argv[MAX_ARGS + 1]; /* argv[0] must always be the program */ }; struct call_function_type @@ -343,6 +347,21 @@ struct shared_object *next; }; +struct modprobe +{ + flag verbose_option; /* on command line/devfsd.conf/env */ + flag verbose_config; + + char path_option[STRING_LENGTH]; + char path_config[STRING_LENGTH]; + char path[STRING_LENGTH]; + + int argc; + char *argv[MAX_ARGV_ARGS + 1]; + char extra_argv[MAX_ARGV_ARGS + 1][STRING_LENGTH]; /* for extra params in config file */ + + int (*func) (int argc, char **argv); +}; /* External functions */ EXTERN_FUNCTION (flag st_expr_expand, @@ -415,6 +434,21 @@ /* Private data */ +static struct modprobe modprobe = +{ + verbose_option: -1, + verbose_config: -1, + path_option: "", + path_config: "", + path: "", + + argc: 0, + argv: { NULL }, + extra_argv: { "", "" }, + + func: NULL, +}; + static struct config_entry_struct *first_config = NULL; static struct config_entry_struct *last_config = NULL; static struct shared_object *first_so = NULL; @@ -452,7 +486,7 @@ unsigned long event_mask = 0; struct sigaction new_action; struct stat statbuf; - static char usage[] = "devfsd mntpnt [-v] [-d] [-t num] [-D mask] [-fg] [-np]"; + static char usage[] = "devfsd mntpnt [-v] [-d] [-t num] [-D mask] [-fg] [-np] [-m[nv|v] [modprobe]]"; if (argc < 2) { @@ -476,6 +510,22 @@ } else if (strcmp (argv[count], "-fg") == 0) do_daemon = FALSE; else if (strcmp (argv[count], "-np") == 0) no_polling = TRUE; + else if (strcmp (argv[count], "-mnv") == 0) /* modprobe non verbose */ + { + modprobe.verbose_option = FALSE; + if ((count + 1) < argc && argv[count + 1][0] != '-') + strncpy(modprobe.path_option, argv[++count], STRING_LENGTH); + } + else if (strcmp (argv[count], "-mv") == 0) /* modprobe verbose */ + { + modprobe.verbose_option = TRUE; + if ((count + 1) < argc && argv[count + 1][0] != '-') + strncpy(modprobe.path_option, argv[++count], STRING_LENGTH); + } + else if ( (strcmp (argv[count], "-m") == 0) && (++count < argc) ) /* modprobe */ + { + strncpy(modprobe.path_option, argv[count], STRING_LENGTH); + } else { fprintf (stderr, "Usage:\t%s\n", usage); @@ -730,7 +780,7 @@ { int err, num_args, count; struct config_entry_struct *new; - char p[MAX_ARGS][STRING_LENGTH]; + char p[MAX_ARGS + 1][STRING_LENGTH]; char when[STRING_LENGTH], what[STRING_LENGTH]; char name[STRING_LENGTH], tmp[STRING_LENGTH]; @@ -759,6 +809,40 @@ event_mask); return; } + if (strcasecmp (when, "MODPROBE") == 0) /* set the modprobe path/and or option */ + { + if (strcasecmp(name, "DEFAULT") == 0) + modprobe.path_config[0] = '\0'; /* get modprobe from /proc/sys/kernel/modprobe */ + else if ( (strcasecmp(name, "CURRENT") != 0) && /* if match CURRENT|.* use the current value, don't set it */ + (strcasecmp(name, ".*") != 0) ) + strncpy(modprobe.path_config, name, STRING_LENGTH); /* else take the argument */ + + if (num_args > 2) + { + if (strcasecmp(what, "VERBOSE") == 0) /* be verbose */ + modprobe.verbose_config = TRUE; + else if (strcasecmp(what, "NORMAL") == 0) /* don't be verbose */ + modprobe.verbose_config = FALSE; + else if ( (strcasecmp(what, "ARGS") == 0) || + (strcasecmp(what, "ARGUMENTS") == 0) ) + { + int i; + + /* read all args and store them in the modprobe structure */ + for(i = 0; i < num_args - 3; i++) + strncpy(modprobe.extra_argv[i], p[i], STRING_LENGTH); + + modprobe.extra_argv[i][0] = '\0'; + } + else + { + SYSLOG (LOG_ERR, "bad config line: \"%s\"\n", line); + SYSLOG (LOG_ERR, "exiting\n"); + exit (1); + } + } + return; + } if (num_args < 3) { SYSLOG (LOG_ERR, "bad config line: \"%s\"\n", line); @@ -1123,6 +1207,37 @@ } } /* End Function action_permissions */ +static char * modprobe_find(void) +{ + FILE *file; + int num; + + /* modprobe path must be configurable at runtime + o default /sbin/modprobe + o from /proc/sys/kernel/modprobe + o parameter on command line + o from devfsd.conf + */ + + if (modprobe.path_option[0] != '\0') + return modprobe.path_option; /* use the one provided on the command line */ + + if (modprobe.path_config[0] != '\0') + return modprobe.path_config; /* use the one found in config file */ + + file = fopen("/proc/sys/kernel/modprobe", "r"); + if (file != NULL) + { + num = fscanf(file, "%s", modprobe.path); + fclose(file); + + if (num == 1) + return modprobe.path; + } + + return MODPROBE; /* use the default path */ +} + static void action_modload (const struct devfsd_notify_struct *info, const struct config_entry_struct *entry) /* [SUMMARY] Load a module. @@ -1131,38 +1246,60 @@ [RETURNS] Nothing. */ { - char *argv[6]; char device[STRING_LENGTH]; - static int (*modprobe) (int argc, char **argv) = NULL; - static flag first_time = TRUE; - - if (first_time) - { - void *lib; + void *lib; + int i; + + /* can't compute args only one time, must be resetup when devfsd.conf is reread (SIGHUP) */ + + modprobe.argc = 0; + modprobe.argv[modprobe.argc ++] = NULL; /* place for modprobe path */ + if ( (modprobe.verbose_option == TRUE) || + (modprobe.verbose_option == -1 && modprobe.verbose_config == TRUE) ) + { + modprobe.argv[modprobe.argc ++] = "-s"; /* use syslog */ + modprobe.argv[modprobe.argc ++] = "-v"; /* be verbose */ + } + + /* add extra args */ + for(i = 0; modprobe.extra_argv[i][0] != '\0' ; i++) + modprobe.argv[modprobe.argc ++] = modprobe.extra_argv[i]; + + modprobe.argv[modprobe.argc ++] = "-k"; /* Auto unload this module if unused */ + modprobe.argv[modprobe.argc ++] = "-C"; /* use this config file : */ + modprobe.argv[modprobe.argc ++] = "/etc/modules.devfs"; + + modprobe.argv[modprobe.argc ++] = NULL; /* place for the device name */ + modprobe.argv[modprobe.argc] = NULL; - first_time = FALSE; - if ( ( lib = dlopen ("/lib/modutils.so", RTLD_NOW) ) != NULL ) - modprobe = dlsym (lib, "modprobe"); - } - argv[0] = "/sbin/modprobe"; - argv[1] = "-k"; - argv[2] = "-C"; - argv[3] = "/etc/modules.devfs"; - argv[4] = device; - argv[5] = NULL; + /* compute really dynamic parameter (those that don't depend of us directly) */ + modprobe.argv[0] = modprobe_find(); snprintf (device, sizeof (device), "/dev/%s", info->devname); + modprobe.argv[modprobe.argc - 1] = device; + + /* always try to open this */ + lib = dlopen ("/lib/modutils.so", RTLD_NOW); + if ( lib != NULL ) + modprobe.func = dlsym (lib, "modprobe"); + else + modprobe.func = NULL; + if (trace_level > 1) fprintf (stderr, "Calling modprobe with name: \"%s\"\n", device); - if (modprobe != NULL) + if (modprobe.func != NULL) { - (*modprobe) (5, argv); + /* use the function from the library */ + (*modprobe.func) (modprobe.argc, modprobe.argv); return; } switch ( fork () ) { case 0: /* Child */ - break; + execvp (modprobe.argv[0], modprobe.argv); + SYSLOG (LOG_ERR, "error execing: \"%s\"\t%s\n", modprobe.argv[0], ERRSTRING); + _exit (1); + /* break; */ case -1: /* Error */ SYSLOG (LOG_ERR, "error forking\t%s\n", ERRSTRING); @@ -1174,15 +1311,12 @@ return; /*break;*/ } - execvp (argv[0], argv); - SYSLOG (LOG_ERR, "error execing: \"%s\"\t%s\n", argv[0], ERRSTRING); - _exit (1); } /* End Function action_modload */ static void action_execute (const struct devfsd_notify_struct *info, const struct config_entry_struct *entry, const regmatch_t *regexpr, unsigned int numexpr) -/* [SUMMARY] Execute a programme. +/* [SUMMARY] Execute a program. The devfs change. The config file entry. The number of subexpression (start, end) offsets within the @@ -1222,7 +1356,7 @@ break; case -1: /* Error */ - SYSLOG (LOG_ERR, "error forking for programme: %s\t%s\n", + SYSLOG (LOG_ERR, "error forking for program: %s\t%s\n", argv[0], ERRSTRING); return; /*break;*/ diff -ur devfsd-1.3.18/devfsd.conf devfsd-1.3.18-meuh/devfsd.conf --- devfsd-1.3.18/devfsd.conf Thu Mar 29 22:05:37 2001 +++ devfsd-1.3.18-meuh/devfsd.conf Fri Nov 16 23:39:20 2001 @@ -1,6 +1,16 @@ # Sample /etc/devfsd.conf configuration file. # Richard Gooch 3-JUL-2000 # +# Some configuration tricks for modprobe +# use this modprobe +#MODPROBE /sbin/modprobe +# make modprobe verbose (pass -s -v flags) +#MODPROBE .* VERBOSE +# add some flags to the modprobe command line +#MODPROBE current ARGS -a -d +# use the default modprobe (from /proc/sys/kernel/modprobe or "/sbin/modprobe") +#MODPROBE default + # Enable full compatibility mode for old device names. You may comment these # out if you don't use the old device names. Make sure you know what you're # doing! ========== patch-devfsd-meuh-modprobe-arguments ====================== From owner-devfs@oss.sgi.com Thu Nov 22 00:44:35 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAM8iZf13808 for devfs-outgoing; Thu, 22 Nov 2001 00:44:35 -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 fAM8iMo13764 for ; Thu, 22 Nov 2001 00:44:23 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAM7i8s28650; Thu, 22 Nov 2001 00:44:08 -0700 Date: Thu, 22 Nov 2001 00:44:08 -0700 Message-Id: <200111220744.fAM7i8s28650@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v198 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 198 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. NOTE: this patch is important because it removes the limitation on the number of events that can be queued to devfsd. People who were experiencing lost events (i.e. with ISDN cards or the sd-many patch and the driver loaded as a module) should find the problem resolved. PLEASE: test out this code. I've had only one person report back to me so far. If it works, let me know that too. Don't just complain if it doesn't work. 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.15-pre9. Highlights of this release: - Discard temporary buffer, now use "%s" for dentry names - Don't generate path in : use fake entry instead - Use "existing" directory in <_devfs_make_parent_for_leaf> - Use slab cache rather than fixed buffer for devfsd events Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Nov 22 21:27:26 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAN5RQ329898 for devfs-outgoing; Thu, 22 Nov 2001 21:27: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 fAN5RIo29894 for ; Thu, 22 Nov 2001 21:27:18 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAN4RO207006; Thu, 22 Nov 2001 21:27:24 -0700 Date: Thu, 22 Nov 2001 21:27:24 -0700 Message-Id: <200111230427.fAN4RO207006@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Yann Droneaud Cc: devfs@oss.sgi.com Subject: Re: [PATCH] configuration for modprobe In-Reply-To: <200111162309.AAA05838@corwin.ambre.meuh.eu.org> References: <200111162309.AAA05838@corwin.ambre.meuh.eu.org> Sender: owner-devfs@oss.sgi.com Precedence: bulk Yann Droneaud writes: > here is a quite big patch against devfsd v1.3.18. Yes, too big. It does more than one thing, so it makes it harder for me to pick and choose things I like and reject things I don't like. Since there's bits I didn't like, the whole patch is rejected. > This enable user to select which modprobe to use, > This also let the user specify arguments to pass to it. > The config options could be put in devfsd.conf or on command line. > Command line options have a higher priority. I think this level of flexbility isn't needed. I have yet to see a good reason why modprobe isn't in /sbin. Furthermore, adding these configuration options bloats the code more. I'm taking a hard line with extra code, because I want devfsd to be very small. Think embedded systems. I'll make some comments about things I noticed in the patch, so you can get an idea of my likes and dislikes. > + Last updated by Yann Droneaud 16-NOV-2001: support for > + modprobe configuration (which modprobe use and with what parameters) Including the email address isn't the style I like: it fouls up the formatting. > -#define MAX_ARGS (6 + 1) > +#define MAX_ARGS (6 + 1) > +#define MAX_ARGV_ARGS 16 /* number of arguments passed to modprobe */ > #define MAX_SUBEXPR 10 Gratuitous formatting change. Not something that should be included with a patch that makes functional changes. > - char *argv[MAX_ARGS + 1]; /* argv[0] must always be the programme */ > + char *argv[MAX_ARGS + 1]; /* argv[0] must always be the program */ Grrr, "programme" is *correct* spelling. This is just annoying. Before attempting to correct my spelling, check with the OED (Oxford English Dictionary). > + if (modprobe.path_config[0] != '\0') > + return modprobe.path_config; /* use the one found in config file */ You missed a "the" in the comment. > + /* can't compute args only one time, must be resetup when devfsd.conf is reread (SIGHUP) */ "resetup" isn't a real word. > + /* compute really dynamic parameter (those that don't depend of us directly) */ Typo? Should be "on" instead of "of"? > - SYSLOG (LOG_ERR, "error forking for programme: %s\t%s\n", > + SYSLOG (LOG_ERR, "error forking for program: %s\t%s\n", More bogus spelling corrections. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Nov 22 22:12:29 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAN6CTu03493 for devfs-outgoing; Thu, 22 Nov 2001 22:12: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 fAN6COo03490 for ; Thu, 22 Nov 2001 22:12:24 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAN5CHq07568; Thu, 22 Nov 2001 22:12:17 -0700 Date: Thu, 22 Nov 2001 22:12:17 -0700 Message-Id: <200111230512.fAN5CHq07568@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Pavel Roskin Cc: Subject: Re: Patch for GNUmakefile and rpm.spec In-Reply-To: References: Sender: owner-devfs@oss.sgi.com Precedence: bulk Pavel Roskin writes: > RedHat 7.2 doesn't have /usr/man - it keeps manuals in /usr/share/man. > However, manuals are searched in /usr/man as well. Failure to install > manuals causes config files not to be installed. > > It's generally a good idea to create directories before installing > anything to them, especially since supporting PREFIX suggests that > installing to a clean directory is supported. Also "install" should be > preferred over "cp" whenever possible. > > There was no symbolic name for the directory holding devfsd.conf and > modules.devfs (for the purpose of its creation), so I named it CONFDIR. > Now it's possible to install devfs into an empty directory. OK, I've taken some of the ideas from your GNUmakefile patch and updated the GNUmakefile. > I also made necessary updates to rpm.spec. No patches are needed > anymore (and by the way, devfsd-install-path-patch was missing). > "make install" can now be trusted (just the path for manuals has to > be overridden). Also it's taken into account that the manual pages > may be compressed - suffixes are allowed in their names. Finally, > sanity checks for $RPM_BUILD_ROOT have been eliminated - I don't > think that any recent version of rpm can "forget" to set it. OK. I don't know rpm, so I'll just trust you on this. I didn't hear Bill squawk, so I assume he's OK with this change. Bill? > Don't forget to change "version" in rpm.spec when releasing next > versions. Well, it's not going to happen manually. I won't remember. However, I've made it automated via the GNUmakefile. Make is a wonderful thing :-) Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Nov 22 23:37:50 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAN7bop14205 for devfs-outgoing; Thu, 22 Nov 2001 23:37:50 -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 fAN7bio14201 for ; Thu, 22 Nov 2001 23:37:44 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAN6ZwF08435; Thu, 22 Nov 2001 23:35:58 -0700 Date: Thu, 22 Nov 2001 23:35:58 -0700 Message-Id: <200111230635.fAN6ZwF08435@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Russell Coker Cc: devfs@oss.sgi.com Subject: Re: Re: setsid() and new sysvinit Sender: owner-devfs@oss.sgi.com Precedence: bulk Going back to an earlier thread: Russell Coker writes: > Firstly I just noticed that devfsd is not calling setsid() after doing > close(0);close(1);close(2); is there a good reason for this or is it an > oversight? It is my understanding that all daemons should call setsid()... > > I came across this while investigating a problem that occurs with the latest > sysvinit package in Debian. Sysvinit now makes /dev/console the controlling > terminal for daemons started before multi-user mode is initiated. This means > that it will be sent a SIGHUP by the kernel when the session ends (IE > multi-user mode is started). > > The SIGHUP results in the configuration reload which displays annoying error > messages to the console. > > With the current way devfsd works the console is kept open until /dev/log is > created, at which time openlog() is called and the stdin/stdout/stderr are > closed. > > But the session is ended before syslogd is started. > > What can we do about this? Would it be a good idea to do > close(0);close(1);close(2); at the start of the program and then > open("/dev/console", O_WRONLY|O_NOCTTY); ? > > Of course if you want to start devfsd on some other device and have > all the error messages go there before syslogd is started and not > have the messages go there then this won't be what you want. And I responded: Why not just call setsid(2) after closing fds[0:2]? I've just added that to me tree. That avoids the problem you describe above with having the output go elsewhere and then being redirected to /dev/console. Well, now I have another suggestion: call setsid(2) as soon as calling fork(2), rather than wait until closure of fds[0:2]. This would prevent hangups from the console reaching devfsd even before it calls openlog(3). It won't prevent console output prior to openlog(3) being called, however. Anyone see any reason not to call setsid(2) early? I'm making this change, so speak up... Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Fri Nov 23 05:33:16 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fANDXGb09128 for devfs-outgoing; Fri, 23 Nov 2001 05:33:16 -0800 Received: from iupmime.univ-lemans.fr (iupmime.univ-lemans.fr [193.52.29.129]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fANDX3o09085 for ; Fri, 23 Nov 2001 05:33:03 -0800 Received: from lucke.univ-lemans.fr (lucke [193.52.29.139]) by iupmime.univ-lemans.fr (8.11.6/8.11.6) with ESMTP id fANCZES20757; Fri, 23 Nov 2001 13:35:14 +0100 (MET) Received: (from p9937@localhost) by lucke.univ-lemans.fr (8.10.2+Sun/8.10.2) id fANCZFd18427; Fri, 23 Nov 2001 13:35:15 +0100 (MET) Date: Fri, 23 Nov 2001 13:35:15 +0100 (MET) Message-Id: <200111231235.fANCZFd18427@lucke.univ-lemans.fr> From: Yann Droneaud To: rgooch@ras.ucalgary.ca CC: ydroneaud@meuh.eu.org, devfs@oss.sgi.com In-reply-to: <200111230427.fAN4RO207006@vindaloo.ras.ucalgary.ca> (message from Richard Gooch on Thu, 22 Nov 2001 21:27:24 -0700) Subject: Re: [PATCH] configuration for modprobe References: <200111162309.AAA05838@corwin.ambre.meuh.eu.org> <200111230427.fAN4RO207006@vindaloo.ras.ucalgary.ca> Sender: owner-devfs@oss.sgi.com Precedence: bulk > Date: Thu, 22 Nov 2001 21:27:24 -0700 > From: Richard Gooch > Cc: devfs@oss.sgi.com > References: <200111162309.AAA05838@corwin.ambre.meuh.eu.org> > Content-Length: 2392 > > Yann Droneaud writes: > > here is a quite big patch against devfsd v1.3.18. > > Yes, too big. It does more than one thing, so it makes it harder for > me to pick and choose things I like and reject things I don't like. > Since there's bits I didn't like, the whole patch is rejected. > Ok, but i don't think i can split it, since all things are related. > > This enable user to select which modprobe to use, > > This also let the user specify arguments to pass to it. > > The config options could be put in devfsd.conf or on command line. > > Command line options have a higher priority. > > I think this level of flexbility isn't needed. I have yet to see a > good reason why modprobe isn't in /sbin. Furthermore, adding these > configuration options bloats the code more. I'm taking a hard line > with extra code, because I want devfsd to be very small. Think > embedded systems. Yes it's not designed for embedded target, but it could be a build time option (a #define FULL_DEVFSD) to make it more versatile. It's up to you. If you decided it's really not interesting, don't include those functionnalities. I will use them for my private use (quite limited, i could simply hard code the modprobe and flags i wanted) > > I'll make some comments about things I noticed in the patch, so you > can get an idea of my likes and dislikes. > > > + Last updated by Yann Droneaud 16-NOV-2001: support for > > + modprobe configuration (which modprobe use and with what parameters) > > Including the email address isn't the style I like: it fouls up the > formatting. > > > -#define MAX_ARGS (6 + 1) > > +#define MAX_ARGS (6 + 1) > > +#define MAX_ARGV_ARGS 16 /* number of arguments passed to modprobe */ > > #define MAX_SUBEXPR 10 > > Gratuitous formatting change. Not something that should be included > with a patch that makes functional changes. > > > - char *argv[MAX_ARGS + 1]; /* argv[0] must always be the programme */ > > + char *argv[MAX_ARGS + 1]; /* argv[0] must always be the program */ > > Grrr, "programme" is *correct* spelling. This is just annoying. Before > attempting to correct my spelling, check with the OED (Oxford English > Dictionary). Sorry, i didn't know that correct spelling is 'programme', this sound too much like the french word. This is why i 'corrected' them. > > > + if (modprobe.path_config[0] != '\0') > > + return modprobe.path_config; /* use the one found in config file */ > > You missed a "the" in the comment. > > > + /* can't compute args only one time, must be resetup when devfsd.conf is reread (SIGHUP) */ > > "resetup" isn't a real word. Frenchies like me are not rigorous with the language. This is the only reasons i see ;) > > > + /* compute really dynamic parameter (those that don't depend of us directly) */ > > Typo? Should be "on" instead of "of"? > > > - SYSLOG (LOG_ERR, "error forking for programme: %s\t%s\n", > > + SYSLOG (LOG_ERR, "error forking for program: %s\t%s\n", > > More bogus spelling corrections. > ;) > Regards, > > Richard.... > Permanent: rgooch@atnf.csiro.au > Current: rgooch@ras.ucalgary.ca > > Thank you for your comments, I will try to handle them. -- Yann Droneaud +33 6 88 40 82 43 1024D/BEA43321 5D91 B5B0 5137 B8FE 6882 FE19 CAA0 6F05 BEA4 3321 http://www.meuh.eu.org http://www-iupmime.univ-lemans.fr From owner-devfs@oss.sgi.com Fri Nov 23 09:40:22 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fANHeMV20100 for devfs-outgoing; Fri, 23 Nov 2001 09:40: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 fANHeAo20097 for ; Fri, 23 Nov 2001 09:40:10 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fANGe5b13352; Fri, 23 Nov 2001 09:40:05 -0700 Date: Fri, 23 Nov 2001 09:40:05 -0700 Message-Id: <200111231640.fANGe5b13352@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Yann Droneaud Cc: devfs@oss.sgi.com Subject: Re: [PATCH] configuration for modprobe In-Reply-To: <200111231235.fANCZFd18427@lucke.univ-lemans.fr> References: <200111162309.AAA05838@corwin.ambre.meuh.eu.org> <200111230427.fAN4RO207006@vindaloo.ras.ucalgary.ca> <200111231235.fANCZFd18427@lucke.univ-lemans.fr> Sender: owner-devfs@oss.sgi.com Precedence: bulk Yann Droneaud writes: > > Date: Thu, 22 Nov 2001 21:27:24 -0700 > > From: Richard Gooch > > Cc: devfs@oss.sgi.com > > References: <200111162309.AAA05838@corwin.ambre.meuh.eu.org> > > Content-Length: 2392 > > > > Yann Droneaud writes: > > > here is a quite big patch against devfsd v1.3.18. > > > > Yes, too big. It does more than one thing, so it makes it harder for > > me to pick and choose things I like and reject things I don't like. > > Since there's bits I didn't like, the whole patch is rejected. > > > > Ok, but i don't think i can split it, since all things are related. Well, some things you could have split. Like the GNUmakefile changes. And the formatting changes. And the spelling changes. I know it's more work for you, but it's less work for me :-) > > > This enable user to select which modprobe to use, > > > This also let the user specify arguments to pass to it. > > > The config options could be put in devfsd.conf or on command line. > > > Command line options have a higher priority. > > > > I think this level of flexbility isn't needed. I have yet to see a > > good reason why modprobe isn't in /sbin. Furthermore, adding these > > configuration options bloats the code more. I'm taking a hard line > > with extra code, because I want devfsd to be very small. Think > > embedded systems. > > Yes it's not designed for embedded target, but it could be a build > time option (a #define FULL_DEVFSD) to make it more versatile. It's > up to you. If you decided it's really > not interesting, don't > include those functionnalities. > I will use them for my private > use (quite limited, i could simply hard code the modprobe and flags > i wanted) Well, I don't mind adding stuff to the GNUmakefile to make it a compile-time option. That won't bloat the code. Two questions: - why do you want to change the location of modprobe - why do you want to pass extra flags to it? > > Grrr, "programme" is *correct* spelling. This is just annoying. Before > > attempting to correct my spelling, check with the OED (Oxford English > > Dictionary). > > Sorry, i didn't know that correct spelling is 'programme', this > sound too much like the french word. This is why i 'corrected' them. Hey, half of English is French anyway (remember the Normans?). Which is why I always get a chuckle when I hear about French language laws which are designed to keep English out (i.e. keep out half of French:-). > > "resetup" isn't a real word. > > Frenchies like me are not rigorous with the language. This is the > only reasons i see ;) In any case, I'm a pedant. BTW: I've got a bunch of changes which are pending for the next release. Any patches you send now could easily break. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Fri Nov 23 09:47:44 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fANHliL21380 for devfs-outgoing; Fri, 23 Nov 2001 09:47:44 -0800 Received: from thalassa.informatimago.com (postfix@thalassa.informatimago.com [212.87.205.57]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fANHldo21361 for ; Fri, 23 Nov 2001 09:47:39 -0800 Received: by thalassa.informatimago.com (Postfix on SuSE Linux 7.1 (i386), from userid 1000) id EF7FE5D67B; Fri, 23 Nov 2001 17:47:35 +0100 (CET) From: Pascal Bourguignon To: rgooch@ras.ucalgary.ca Cc: ydroneaud@meuh.eu.org, devfs@oss.sgi.com In-reply-to: <200111231640.fANGe5b13352@vindaloo.ras.ucalgary.ca> (message from Richard Gooch on Fri, 23 Nov 2001 09:40:05 -0700) Subject: [ot] languages Was: [PATCH] configuration for modprobe Organization: InformatiMago. X-PGP-Key-ID: 0xEF5E9966 X-PGP-fingerprint: 00 F5 7B DB CA 51 8A AD 04 5B 6C DE 32 60 16 8E EF 5E 99 66 X-PGP-Public-Key: http://www.informatimago.com/pgpkey.asc X-URL: http://www.informatimago.com/index X-Accept-Language: fr, es, en Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: text/plain; charset=iso-8859-1 Content-Language: fr, es, en Reply-To: References: <200111162309.AAA05838@corwin.ambre.meuh.eu.org> <200111230427.fAN4RO207006@vindaloo.ras.ucalgary.ca> <200111231235.fANCZFd18427@lucke.univ-lemans.fr> <200111231640.fANGe5b13352@vindaloo.ras.ucalgary.ca> Message-Id: <20011123164735.EF7FE5D67B@thalassa.informatimago.com> Date: Fri, 23 Nov 2001 17:47:35 +0100 (CET) Sender: owner-devfs@oss.sgi.com Precedence: bulk Richard Gooch wrote: > > Yann Droneaud writes: > > > > Grrr, "programme" is *correct* spelling. This is just annoying. Before > > > attempting to correct my spelling, check with the OED (Oxford English > > > Dictionary). > > > > Sorry, i didn't know that correct spelling is 'programme', this > > sound too much like the french word. This is why i 'corrected' them. > > Hey, half of English is French anyway (remember the Normans?). Which > is why I always get a chuckle when I hear about French language laws > which are designed to keep English out (i.e. keep out half of > French:-). Right. And the other half of English comes from Latin ;-) Which leads some linguists to say that English is the most latin of anglosaxon languages and French the most anglosaxon of latin languages. -- __Pascal_Bourguignon__ (o_ Software patents are endangering () ASCII ribbon against html email //\ the computer industry all around /\ and Microsoft attachments. V_/ the world http://lpf.ai.mit.edu/ 1962:DO20I=1.100 2001:my($f)=`fortune`; http://petition.eurolinux.org/ -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/IT d? s++:++(+++)>++ a C+++ UB+++L++++$S+X++++>$ P- L+++ E++ W++ N++ o-- K- w------ O- M++$ V PS+E++ Y++ PGP++ t+ 5? X+ R !tv b++(+) DI+++ D++ G++ e+++ h+(++) r? y---? UF++++ ------END GEEK CODE BLOCK------ From owner-devfs@oss.sgi.com Fri Nov 23 09:49:50 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fANHnon21775 for devfs-outgoing; Fri, 23 Nov 2001 09:49:50 -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 fANHnko21763 for ; Fri, 23 Nov 2001 09:49:46 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fANGngj13532; Fri, 23 Nov 2001 09:49:42 -0700 Date: Fri, 23 Nov 2001 09:49:42 -0700 Message-Id: <200111231649.fANGngj13532@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Cc: ydroneaud@meuh.eu.org, devfs@oss.sgi.com Subject: Re: [ot] languages Was: [PATCH] configuration for modprobe In-Reply-To: <20011123164735.EF7FE5D67B@thalassa.informatimago.com> References: <200111162309.AAA05838@corwin.ambre.meuh.eu.org> <200111230427.fAN4RO207006@vindaloo.ras.ucalgary.ca> <200111231235.fANCZFd18427@lucke.univ-lemans.fr> <200111231640.fANGe5b13352@vindaloo.ras.ucalgary.ca> <20011123164735.EF7FE5D67B@thalassa.informatimago.com> Sender: owner-devfs@oss.sgi.com Precedence: bulk Pascal Bourguignon writes: > > Richard Gooch wrote: > > > > Yann Droneaud writes: > > > > > > Grrr, "programme" is *correct* spelling. This is just annoying. Before > > > > attempting to correct my spelling, check with the OED (Oxford English > > > > Dictionary). > > > > > > Sorry, i didn't know that correct spelling is 'programme', this > > > sound too much like the french word. This is why i 'corrected' them. > > > > Hey, half of English is French anyway (remember the Normans?). Which > > is why I always get a chuckle when I hear about French language laws > > which are designed to keep English out (i.e. keep out half of > > French:-). > > Right. And the other half of English comes from Latin ;-) Which > leads some linguists to say that English is the most latin of > anglosaxon languages and French the most anglosaxon of latin > languages. So what's all the fighting been about? ;-) Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Tue Nov 27 23:24:55 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAS7OtQ05282 for devfs-outgoing; Tue, 27 Nov 2001 23:24: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 fAS7Opo05273 for ; Tue, 27 Nov 2001 23:24:51 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAS6OYA11381; Tue, 27 Nov 2001 23:24:34 -0700 Date: Tue, 27 Nov 2001 23:24:34 -0700 Message-Id: <200111280624.fAS6OYA11381@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v199 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 199 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.16-pre1. Highlights of this release: - Removed obsolete usage of DEVFS_FL_NO_PERSISTENCE - Send DEVFSD_NOTIFY_REGISTERED events in - Fixed locking bug in due to typo - Do not send CREATE, CHANGE, ASYNC_OPEN or DELETE events from devfsd or children Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Wed Nov 28 00:35:00 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAS8Z0q06609 for devfs-outgoing; Wed, 28 Nov 2001 00:35: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 fAS8Yso06605 for ; Wed, 28 Nov 2001 00:34:54 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAS7Yop12246; Wed, 28 Nov 2001 00:34:50 -0700 Date: Wed, 28 Nov 2001 00:34:50 -0700 Message-Id: <200111280734.fAS7Yop12246@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: [PATCH] devfs v200 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. Version 200 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-pre2. Highlights of this release: - Ported to kernel 2.5.1-pre2 Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Wed Nov 28 00:58:42 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAS8wgv07202 for devfs-outgoing; Wed, 28 Nov 2001 00:58:42 -0800 Received: from stud.uni-goettingen.de (root@s2.stud.uni-goettingen.de [134.76.60.22]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAS8wao07199 for ; Wed, 28 Nov 2001 00:58:36 -0800 Received: from [10.10.65.104] (helo=stud.uni-goettingen.de) by stud.uni-goettingen.de with esmtp (Exim 2.12 #8) id 168zc1-0007h7-00; Wed, 28 Nov 2001 08:58:33 +0100 Message-ID: <3C049615.6010103@stud.uni-goettingen.de> Date: Wed, 28 Nov 2001 08:45:25 +0100 From: Tobias Edler User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.5+) Gecko/20011022 X-Accept-Language: de, en MIME-Version: 1.0 To: devfs@oss.sgi.com CC: =?ISO-8859-2?Q?Rafa=B3?= Bursig Subject: Re: alsa and devfs References: <3C02B01F.CF7D4DED@poczta.fm> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit Sender: owner-devfs@oss.sgi.com Precedence: bulk Rafa³ Bursig wrote: > edit /etc/modules.devfs and add ... > > alias /dev/snd snd-card-0 > alias /dev/snd/seq snd-seq (if you want sequencer support) > > if you want oss support you must edit modules.conf and add (after > services declarations) > > alias /dev/dsp snd-service-0-3 > etc. did so, didnt help. The problem ist that the OSS-style devices are not created at all. /dev/snd contains: crw-rw---- 1 root user 116, 0 Jan 1 1970 controlC0 crw-rw---- 1 root user 116, 32 Jan 1 1970 controlC1 crw-rw---- 1 root user 116, 64 Jan 1 1970 controlC2 crw-rw---- 1 root user 116, 96 Jan 1 1970 controlC3 crw-rw---- 1 root user 116, 128 Jan 1 1970 controlC4 crw-rw---- 1 root user 116, 160 Jan 1 1970 controlC5 crw-rw---- 1 root user 116, 192 Jan 1 1970 controlC6 crw-rw---- 1 root user 116, 224 Jan 1 1970 controlC7 crw-rw---- 1 root user 116, 4 Jan 1 1970 hwC0D0 crw-rw---- 1 root user 116, 8 Jan 1 1970 midiC0D0 crw-rw---- 1 root user 116, 24 Jan 1 1970 pcmC0D0c crw-rw---- 1 root user 116, 16 Jan 1 1970 pcmC0D0p crw-rw---- 1 root user 116, 33 Jan 1 1970 timer Thanx in advance From owner-devfs@oss.sgi.com Wed Nov 28 12:12:46 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fASKCk303525 for devfs-outgoing; Wed, 28 Nov 2001 12:12:46 -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 fASKCdo03520 for ; Wed, 28 Nov 2001 12:12:39 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fASJCEi18790; Wed, 28 Nov 2001 12:12:14 -0700 Date: Wed, 28 Nov 2001 12:12:14 -0700 Message-Id: <200111281912.fASJCEi18790@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: devfsd-v1.3.19 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. I've just released version 1.3.19 of my devfsd (devfs daemon) at: http://www.atnf.csiro.au/~rgooch/linux/ Tarball directly available from: ftp://ftp.??.kernel.org/pub/linux/daemons/devfsd/devfsd.tar.gz AND: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/daemons/devfsd/devfsd.tar.gz This works with devfs-patch-v130, kernel 2.3.46 and devfs-patch-v99.7 (or later). The main changes are: - Set environment to "safe mode" when invoking modprobe and add better debugging messages for /lib/modutils.so. Based on patch from Russell Coker - Call setsid(2)/setpgid(2) to avoid console hangups and place all devfsd processes in the same process group - Generate synthetic REGISTER event for directories at startup - Made public function which doesn't generate errors on existing symlinks - Updated compatibility entry support for fixed Computone serial driver names - Updated compatibility entry support for pending Cyclades serial driver names. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Wed Nov 28 13:53:13 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fASLrD607966 for devfs-outgoing; Wed, 28 Nov 2001 13:53:13 -0800 Received: from sgi.com (sgi.SGI.COM [192.48.153.1]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fASLr7o07963 for ; Wed, 28 Nov 2001 13:53:07 -0800 Received: from miine.engr.sgi.com (miine.engr.sgi.com [163.154.6.142]) by sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam: SGI does not authorize the use of its proprietary systems or networks for unsolicited or bulk email from the Internet.) via ESMTP id MAA07611 for ; Wed, 28 Nov 2001 12:53:05 -0800 (PST) mail_from (mee@miine.engr.sgi.com) Received: (from mee@localhost) by miine.engr.sgi.com (SGI-8.9.3/8.9.3) id MAA86860; Wed, 28 Nov 2001 12:48:19 -0800 (PST) Date: Wed, 28 Nov 2001 12:48:19 -0800 From: Jeremy Brown To: Tobias Edler Cc: devfs@oss.sgi.com, Rafa? Bursig Subject: Re: alsa and devfs Message-ID: <20011128124819.X135812@miine.engr.sgi.com> References: <3C02B01F.CF7D4DED@poczta.fm> <3C049615.6010103@stud.uni-goettingen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3C049615.6010103@stud.uni-goettingen.de>; from tobias.edler@stud.uni-goettingen.de on Wed, Nov 28, 2001 at 08:45:25AM +0100 Sender: owner-devfs@oss.sgi.com Precedence: bulk On Wed, Nov 28, 2001 at 08:45:25AM +0100, Tobias Edler wrote: [clip] > The problem ist that the OSS-style devices are not created at all. [clip] First off, try the following sequence: 1. Run "alsamixer," and turn up the levels that seem useful to you. I set mine at around 80-90%. 2. Run "/etc/rc.d/init.d/alsasound restart" to save your changes. You don't have to do this explicitly, but I like to, in case I don't shut down properly. 3. Run one of the cute GUI mixers, like gmix or kmix, and turn up the levels again. I have no idea why this is necessary, but it is on my machines. Step 3 will need to be done with every boot. Now, if that didn't work, make sure you're giving modules.conf enough clues. I include a file I call "modules.alsa," and it contains the following (for my little Intel sound chip): # ALSA setup alias char-major-116 snd alias snd-card-0 snd-card-intel8x0 # OSS portion of ALSA setup alias char-major-14 soundcore alias sound-slot-0 snd-card-0 alias sound-service-0-0 snd-mixer-oss alias sound-service-0-1 snd-seq-oss alias sound-service-0-3 snd-pcm-oss alias /dev/dsp snd-pcm-oss alias /dev/mixer snd-mixer-oss alias /dev/sequencer snd-seq-oss Then do steps 1 through 3. Hope this helps! Jeremy Brown SGI From owner-devfs@oss.sgi.com Wed Nov 28 13:57:42 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fASLvgF08173 for devfs-outgoing; Wed, 28 Nov 2001 13:57:42 -0800 Received: from stud.uni-goettingen.de (root@s2.stud.uni-goettingen.de [134.76.60.22]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fASLvTo08069 for ; Wed, 28 Nov 2001 13:57:30 -0800 Received: from [10.10.65.104] (helo=stud.uni-goettingen.de) by stud.uni-goettingen.de with esmtp (Exim 2.12 #8) id 169Blj-0000dO-00; Wed, 28 Nov 2001 21:57:23 +0100 Message-ID: <3C054C95.1060207@stud.uni-goettingen.de> Date: Wed, 28 Nov 2001 21:44:05 +0100 From: Tobias Edler User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.5+) Gecko/20011022 X-Accept-Language: de, en MIME-Version: 1.0 To: =?ISO-8859-2?Q?Rafa=B3?= Bursig , devfs Subject: Re: alsa and devfs (hack) References: <3C02B01F.CF7D4DED@poczta.fm> <3C049615.6010103@stud.uni-goettingen.de> <3C0464D7.172077D4@poczta.fm> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-devfs@oss.sgi.com Precedence: bulk >>The problem ist that the OSS-style devices are not created at all. >> >>/dev/snd contains: >> >>crw-rw---- 1 root user 116, 0 Jan 1 1970 controlC0 >>crw-rw---- 1 root user 116, 32 Jan 1 1970 controlC1 >>crw-rw---- 1 root user 116, 64 Jan 1 1970 controlC2 >>crw-rw---- 1 root user 116, 96 Jan 1 1970 controlC3 >>crw-rw---- 1 root user 116, 128 Jan 1 1970 controlC4 >>crw-rw---- 1 root user 116, 160 Jan 1 1970 controlC5 >>crw-rw---- 1 root user 116, 192 Jan 1 1970 controlC6 >>crw-rw---- 1 root user 116, 224 Jan 1 1970 controlC7 >>crw-rw---- 1 root user 116, 4 Jan 1 1970 hwC0D0 >>crw-rw---- 1 root user 116, 8 Jan 1 1970 midiC0D0 >>crw-rw---- 1 root user 116, 24 Jan 1 1970 pcmC0D0c >>crw-rw---- 1 root user 116, 16 Jan 1 1970 pcmC0D0p >>crw-rw---- 1 root user 116, 33 Jan 1 1970 timer >> >>Thanx in advance >> > > To help you I must know your modules.conf, modules.devfs and "lsmod" > after initialization of /dev/dsp. > post install snd-pcm modprobe -k snd-card-0 did so ... bt didn't help there is so /dev/dsp. at least unless i create it manually with the snddevices script, wich schounl be unnecessary with devfs. modules.conf : alias parport_lowlevel parport_pc alias scsi_hostadapter atp870u alias eth0 8139too alias char-major-81 bttv alias snd-card-0 snd-card-als4000 alias sound-slot-0 snd-card-als4000 alias sound-service-0-0 snd-mixer-oss alias sound-service-0-1 snd-seq-oss alias sound-service-0-3 snd-pcm-oss alias sound-service-0-8 snd-seq-oss alias sound-service-0-12 snd-pcm-oss post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L >/dev/null 2>&1 || : pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S >/dev/null 2>&1 || : alias char-major-195 NVdriver modules.devfs # /etc/modules.devfs # Richard Gooch 16-JUL-2001 # # This file comes with devfsd-v1.3.18 which is available from: # http://www.atnf.csiro.au/~rgooch/linux/ ############################################################################### # Sample configurations that you may want to place in /etc/modules.conf # alias /dev/snd snd-card-0 # Soundcard alias /dev/audio /dev/sound alias /dev/mixer /dev/sound alias /dev/dsp /dev/sound alias /dev/dspW /dev/sound alias /dev/midi /dev/sound include /etc/modules.conf devfsd.conf # Sample /etc/devfsd.conf configuration file. # Richard Gooch 3-JUL-2000 # # Enable full compatibility mode for old device names. You may comment these # out if you don't use the old device names. Make sure you know what you're # doing! REGISTER .* MKOLDCOMPAT UNREGISTER .* RMOLDCOMPAT # You may comment these out if you don't use the original "new" names REGISTER .* MKNEWCOMPAT UNREGISTER .* RMNEWCOMPAT # Enable module autoloading. You may comment this out if you don't use # autoloading LOOKUP .* MODLOAD # For alsa modules ... hope this helps .... LOOKUP snd MODLOAD ACTION snd REGISTER sound/.* PERMISSIONS root.user 660 REGISTER snd/.* PERMISSIONS root.user 660 From owner-devfs@oss.sgi.com Wed Nov 28 15:40:55 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fASNetK11923 for devfs-outgoing; Wed, 28 Nov 2001 15:40:55 -0800 Received: from stud.uni-goettingen.de (root@s2.stud.uni-goettingen.de [134.76.60.22]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fASNero11917 for ; Wed, 28 Nov 2001 15:40:53 -0800 Received: from [10.10.65.104] (helo=stud.uni-goettingen.de) by stud.uni-goettingen.de with esmtp (Exim 2.12 #8) id 169DNi-0006Vi-00; Wed, 28 Nov 2001 23:40:42 +0100 Message-ID: <3C0567EC.4060302@stud.uni-goettingen.de> Date: Wed, 28 Nov 2001 23:40:44 +0100 From: Tobias Edler User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.5+) Gecko/20011022 X-Accept-Language: de, en MIME-Version: 1.0 To: alsa-user@lists.sourceforge.net, devfs Subject: Re: alsa and devfs (hack) SOLVED !! References: <3C02B01F.CF7D4DED@poczta.fm> <3C049615.6010103@stud.uni-goettingen.de> <3C0464D7.172077D4@poczta.fm> <3C054C95.1060207@stud.uni-goettingen.de> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-devfs@oss.sgi.com Precedence: bulk I dont really know why, but it works now. just changed some parport stuff in the kernel and recompilled it ... Thats at least al i can remember since the last reboot. Is anyone interested in my config for some kind of docu ? who maintains that ? Thanks to all that helped me. From owner-devfs@oss.sgi.com Wed Nov 28 15:59:45 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fASNxj512694 for devfs-outgoing; Wed, 28 Nov 2001 15:59:45 -0800 Received: from sabi.co.UK (sabi.claranet.co.uk [212.126.138.20]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fASNxeo12691 for ; Wed, 28 Nov 2001 15:59:40 -0800 Received: from localhost ([127.0.0.1] helo=home.sabi.co.UK) by sabi.co.UK with esmtp (Exim 3.16 #1) id 169Df0-0001Rs-00 for devfs@OSS.SGI.com; Wed, 28 Nov 2001 22:58:35 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15365.27674.846809.286954@home.sabi.co.UK> Date: Wed, 28 Nov 2001 22:58:34 +0000 X-Face: SMJE]JPYVBO-9UR%/8d'mG.F!@.,l@c[f'[%S8'BZIcbQc3/">GrXDwb#;fTRGNmHr^JFbS AptvwWc,0+z+~p~"Gdr4H$(|N(yF(wwCM2bW0~U?HPEE^fkPGx^u[*[yV.gyB!hDOli}EF[\cW*SH< GG"+i\3#fp@@EeWZWBv;]LA5n1pS2VO%Vv[yH?kY'lEWr30WfIU?%>&spRGFL}{`bj1TaD^l/"[msn (/TH#THs{Hpj>)]f> Subject: Re: alsa and devfs In-Reply-To: <20011128124819.X135812@miine.engr.sgi.com> References: <3C02B01F.CF7D4DED@poczta.fm> <3C049615.6010103@stud.uni-goettingen.de> <20011128124819.X135812@miine.engr.sgi.com> X-Mailer: VM 6.95 under 21.4 (patch 4) "Artificial Intelligence" XEmacs Lucid Reply-To: pg_mh@sabi.Clara.co.UK (Piercarlo Grandi) From: pg_mh@sabi.Clara.co.UK (Piercarlo Grandi) X-Disclaimer: This message contains only personal opinions Sender: owner-devfs@oss.sgi.com Precedence: bulk [ ... ] mee> 1. Run "alsamixer," and turn up the levels that seem useful to you. I mee> set mine at around 80-90%. Ahhh, I have just discovered something disturbing about my sound card, a Live! Player: one gets noticeable distortion if anything but the master volume is set to greater than 60-65% (high levels of the master volume have no such problem). This is pretty bad and really surprised me. mee> 2. Run "/etc/rc.d/init.d/alsasound restart" to save your changes. You mee> don't have to do this explicitly, but I like to, in case I don't mee> shut down properly. What you can do is to run just 'alsactl store' (as 'root'), and then make sure that 'alsactl restore' is done either by the '/etc/rc.d/init.d/alsasound' script or you invoke it in a lne in 'rc.local'. mee> 3. Run one of the cute GUI mixers, like gmix or kmix, and turn up the mee> levels again. I have no idea why this is necessary, but it is on my mee> machines. This should not be necessary if 'alsactl restore' is part of the ALSA startup script of your distribution. BTW, the best GUI mixer for ALSA is 'xamixer'; it has a much more compact yet complete layout than the others. From owner-devfs@oss.sgi.com Wed Nov 28 16:10:44 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAT0AiA13290 for devfs-outgoing; Wed, 28 Nov 2001 16:10:44 -0800 Received: from sabi.co.UK (sabi.claranet.co.uk [212.126.138.20]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAT0AXo13283 for ; Wed, 28 Nov 2001 16:10:35 -0800 Received: from localhost ([127.0.0.1] helo=home.sabi.co.UK) by sabi.co.UK with esmtp (Exim 3.16 #1) id 169DpB-0001Tm-00 for devfs@OSS.SGI.com; Wed, 28 Nov 2001 23:09:06 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15365.28305.826585.243408@home.sabi.co.UK> Date: Wed, 28 Nov 2001 23:09:05 +0000 X-Face: SMJE]JPYVBO-9UR%/8d'mG.F!@.,l@c[f'[%S8'BZIcbQc3/">GrXDwb#;fTRGNmHr^JFbS AptvwWc,0+z+~p~"Gdr4H$(|N(yF(wwCM2bW0~U?HPEE^fkPGx^u[*[yV.gyB!hDOli}EF[\cW*SH< GG"+i\3#fp@@EeWZWBv;]LA5n1pS2VO%Vv[yH?kY'lEWr30WfIU?%>&spRGFL}{`bj1TaD^l/"[msn (/TH#THs{Hpj>)]f> Subject: Re: a bug(?), some requests/suggestions In-Reply-To: <200107310056.f6V0uMb13781@mobilix.ras.ucalgary.ca> References: <15196.45808.642654.342681@home.sabi.co.UK> <200107310056.f6V0uMb13781@mobilix.ras.ucalgary.ca> X-Mailer: VM 6.95 under 21.4 (patch 4) "Artificial Intelligence" XEmacs Lucid Reply-To: pg_mh@sabi.Clara.co.UK (Piercarlo Grandi) From: pg_mh@sabi.Clara.co.UK (Piercarlo Grandi) X-Disclaimer: This message contains only personal opinions Sender: owner-devfs@oss.sgi.com Precedence: bulk [ ... ] >> * Another possible bug: in the manuals page for 'devfsd' in the section >> 'CAVEATS' you mention the danger of using a ``devname'' like "cdrom", >> as it is not anchored by either/both '^' or '$'. >> >> However the sample 'devfsd.conf' and some of examples in the FAQ use >> similarly dangerous syntax. I have rewritten these REs in what I think >> is a safer/nicer way (down to details like replacing '.*' with '^.'), >> making essentially all ``devnames'' start with the '^' anchor, which I >> think should be the case. I have attached it. rgooch> Argh! You've changed it from a generic config file to something rgooch> quite specific. [ ... ] Grab a fresh copy of the sample config rgooch> file and edit that. [ ... ] I have finally remembered about this; I have appended a copy of the distributed 'devfsd.conf', with just the regular expressions made tighter (anchored). ------------------------------------------------------------------------ # Sample /etc/devfsd.conf configuration file. # Richard Gooch 28-NOV-2001 # # Enable full compatibility mode for old device names. You may comment these # out if you don't use the old device names. Make sure you know what you're # doing! REGISTER ^ MKOLDCOMPAT UNREGISTER ^ RMOLDCOMPAT # You may comment out the above and uncomment the following if you've # configured your system to use the original "new" devfs names or the really # new names #REGISTER ^vc/ MKOLDCOMPAT #UNREGISTER ^vc/ RMOLDCOMPAT #REGISTER ^pty/ MKOLDCOMPAT #UNREGISTER ^pty/ RMOLDCOMPAT #REGISTER ^misc/ MKOLDCOMPAT #UNREGISTER ^misc/ RMOLDCOMPAT # You may comment these out if you don't use the original "new" names REGISTER ^ MKNEWCOMPAT UNREGISTER ^ RMNEWCOMPAT # Enable module autoloading. You may comment this out if you don't use # autoloading LOOKUP ^ MODLOAD # # Uncomment this if you want permissions to be saved and restored # Do not do this for pseudo-terminal devices #REGISTER ^pt[sy]/ IGNORE #CHANGE ^pt[sy]/ IGNORE #REGISTER ^ COPY /dev-state/$devname $devpath #CHANGE ^ COPY $devpath /dev-state/$devname #CREATE ^ COPY $devpath /dev-state/$devname # # 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 #UNREGISTER ^cdrom/cdrom0$ CFUNCTION GLOBAL unlink cdrom ------------------------------------------------------------------------ From owner-devfs@oss.sgi.com Wed Nov 28 16:22:09 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAT0M9P13854 for devfs-outgoing; Wed, 28 Nov 2001 16:22:09 -0800 Received: from yog-sothoth.sgi.com (eugate.sgi.com [192.48.160.10]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAT0M3o13850 for ; Wed, 28 Nov 2001 16:22:04 -0800 Received: from miine.engr.sgi.com (miine.engr.sgi.com [163.154.6.142]) by yog-sothoth.sgi.com (980305.SGI.8.8.8-aspam-6.2/980304.SGI-aspam-europe) via ESMTP id AAA259130 for ; Thu, 29 Nov 2001 00:22:01 +0100 (CET) mail_from (mee@miine.engr.sgi.com) Received: (from mee@localhost) by miine.engr.sgi.com (SGI-8.9.3/8.9.3) id PAA87276; Wed, 28 Nov 2001 15:17:12 -0800 (PST) Date: Wed, 28 Nov 2001 15:17:12 -0800 From: Jeremy Brown To: Piercarlo Grandi Cc: Linux devfs Subject: Re: alsa and devfs Message-ID: <20011128151712.E286806@miine.engr.sgi.com> References: <3C02B01F.CF7D4DED@poczta.fm> <3C049615.6010103@stud.uni-goettingen.de> <20011128124819.X135812@miine.engr.sgi.com> <15365.27674.846809.286954@home.sabi.co.UK> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <15365.27674.846809.286954@home.sabi.co.UK>; from pg_mh@sabi.Clara.co.UK on Wed, Nov 28, 2001 at 10:58:34PM +0000 Sender: owner-devfs@oss.sgi.com Precedence: bulk Sorry, this is half off-topic... On Wed, Nov 28, 2001 at 10:58:34PM +0000, Piercarlo Grandi wrote: > [ ... ] > > mee> 1. Run "alsamixer," and turn up the levels that seem useful to you. I > mee> set mine at around 80-90%. > > Ahhh, I have just discovered something disturbing about my sound card, a > Live! Player: one gets noticeable distortion if anything but the master > volume is set to greater than 60-65% (high levels of the master volume > have no such problem). This is pretty bad and really surprised me. That's a frustrating discovery! I have via, intel, and crystal sound chips in the machines in my lab, and they all suffer the distortion you mention when a non-master setting exceeds 90%. > mee> 2. Run "/etc/rc.d/init.d/alsasound restart" to save your changes. You > mee> don't have to do this explicitly, but I like to, in case I don't > mee> shut down properly. > > What you can do is to run just 'alsactl store' (as 'root'), and then > make sure that 'alsactl restore' is done either by the > '/etc/rc.d/init.d/alsasound' script or you invoke it in a lne in > 'rc.local'. Oh, that would be the case, wouldn't it? :) Thanks! > mee> 3. Run one of the cute GUI mixers, like gmix or kmix, and turn up the > mee> levels again. I have no idea why this is necessary, but it is on my > mee> machines. > > This should not be necessary if 'alsactl restore' is part of the ALSA > startup script of your distribution. It works when I use alsa without devfs, but does not work when I use alsa with devfs. /dev/sound/dsp and friends are not created until I run gmix or kmix. (That was the on-topic part.) :) > BTW, the best GUI mixer for ALSA is 'xamixer'; it has a much more > compact yet complete layout than the others. I'll take a look at it. Thanks! Jeremy From owner-devfs@oss.sgi.com Wed Nov 28 16:27:38 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAT0RcT14115 for devfs-outgoing; Wed, 28 Nov 2001 16:27:38 -0800 Received: from yog-sothoth.sgi.com (eugate.sgi.com [192.48.160.10]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAT0RYo14112 for ; Wed, 28 Nov 2001 16:27:34 -0800 Received: from miine.engr.sgi.com (miine.engr.sgi.com [163.154.6.142]) by yog-sothoth.sgi.com (980305.SGI.8.8.8-aspam-6.2/980304.SGI-aspam-europe) via ESMTP id AAA250849 for ; Thu, 29 Nov 2001 00:27:31 +0100 (CET) mail_from (mee@miine.engr.sgi.com) Received: (from mee@localhost) by miine.engr.sgi.com (SGI-8.9.3/8.9.3) id PAA87305; Wed, 28 Nov 2001 15:22:42 -0800 (PST) Date: Wed, 28 Nov 2001 15:22:42 -0800 From: Jeremy Brown To: Brad Chapman Cc: Jeremy Brown , devfs@oss.sgi.com Subject: Re: alsa and devfs (maybe OT) Message-ID: <20011128152242.F286806@miine.engr.sgi.com> References: <20011128124819.X135812@miine.engr.sgi.com> <20011128225614.24725.qmail@web20410.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011128225614.24725.qmail@web20410.mail.yahoo.com>; from jabiru_croc@yahoo.com on Wed, Nov 28, 2001 at 02:56:14PM -0800 Sender: owner-devfs@oss.sgi.com Precedence: bulk On Wed, Nov 28, 2001 at 02:56:14PM -0800, Brad Chapman wrote: [clip] > > 3. Run one of the cute GUI mixers, like gmix or kmix, and turn up the > > levels again. I have no idea why this is necessary, but it is on my > > machines. > > I don't need to do that. I'm running ALSA 0.9.0beta9 in the non-kernel-patch > form on top of 2.4.14. I think I have the same thing on one of my boxes - Mandrake 8.1, 2.4.14 kernel, alsa 0.9beta9 (I think), devfs enabled... and I have to run gmix or kmix before I get the devices. I haven't delved deep enough in the source of gmix, kmix, alsamixer, and amixer to determine what the former two seem to be touching that the latter two will not. [clip] > BTW, I'm experiencing lockups when exiting Quake II. I've got the > old OSS-style /dev/sound files setup, but whenever I exit QII it livelocks > and I have to do a Ctrl-Alt-Backspace. Is there any other devfs setup I need? > I'm setting the OSS and ALSA sound devices to root.games 666. Are you running the Enlightenment Sound Daemon (esd)? It has been known to interfere with sound on Quake II. Try killing it before running Quake II. Hope this helps, Jeremy Brown SGI From owner-devfs@oss.sgi.com Wed Nov 28 16:32:30 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAT0WU014258 for devfs-outgoing; Wed, 28 Nov 2001 16:32:30 -0800 Received: from sabi.co.UK (sabi.claranet.co.uk [212.126.138.20]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAT0WNo14254 for ; Wed, 28 Nov 2001 16:32:24 -0800 Received: from localhost ([127.0.0.1] helo=home.sabi.co.UK) by sabi.co.UK with esmtp (Exim 3.16 #1) id 169EBh-0001XO-00 for devfs@OSS.SGI.com; Wed, 28 Nov 2001 23:32:21 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15365.29701.418418.211168@home.sabi.co.UK> Date: Wed, 28 Nov 2001 23:32:21 +0000 X-Face: SMJE]JPYVBO-9UR%/8d'mG.F!@.,l@c[f'[%S8'BZIcbQc3/">GrXDwb#;fTRGNmHr^JFbS AptvwWc,0+z+~p~"Gdr4H$(|N(yF(wwCM2bW0~U?HPEE^fkPGx^u[*[yV.gyB!hDOli}EF[\cW*SH< GG"+i\3#fp@@EeWZWBv;]LA5n1pS2VO%Vv[yH?kY'lEWr30WfIU?%>&spRGFL}{`bj1TaD^l/"[msn (/TH#THs{Hpj>)]f> Subject: Re: alsa and devfs In-Reply-To: <20011128151712.E286806@miine.engr.sgi.com> References: <3C02B01F.CF7D4DED@poczta.fm> <3C049615.6010103@stud.uni-goettingen.de> <20011128124819.X135812@miine.engr.sgi.com> <15365.27674.846809.286954@home.sabi.co.UK> <20011128151712.E286806@miine.engr.sgi.com> X-Mailer: VM 6.95 under 21.4 (patch 4) "Artificial Intelligence" XEmacs Lucid Reply-To: pg_mh@sabi.Clara.co.UK (Piercarlo Grandi) From: pg_mh@sabi.Clara.co.UK (Piercarlo Grandi) X-Disclaimer: This message contains only personal opinions Sender: owner-devfs@oss.sgi.com Precedence: bulk >>> On Wed, 28 Nov 2001 15:17:12 -0800, Jeremy Brown said: [ ... ] mee> 3. Run one of the cute GUI mixers, like gmix or kmix, and turn up the mee> levels again. I have no idea why this is necessary, but it is on my mee> machines. >> This should not be necessary if 'alsactl restore' is part of the ALSA >> startup script of your distribution. mee> It works when I use alsa without devfs, but does not work when I mee> use alsa with devfs. /dev/sound/dsp and friends are not created mee> until I run gmix or kmix. [ ... ] Ahhhhhhhhhh, that's because they are OSS mixers, and they trigger (via MODLOAD it hink) the loading of the three ALSA/OSS ompatibility modules. But 'alsactl' and 'xamixer' (as well as 'amixer' [command line] or 'alsamixer' [curses]) all use the native ALSA devices; and the simulated OSS devices are just wrappers around them (so if you restore the settings of the ALSA devices with 'alsactl' the OSS device settings are reset too). BTW, I just load explicitly in my local boot script the relevant modules: modprobe snd-card-emu10k1 modprobe snd-mixer-oss modprobe snd-pcm-oss modprobe snd-seq-oss This most definitely creates all the relevant entries from the beginning. From owner-devfs@oss.sgi.com Wed Nov 28 16:41:53 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAT0fr714598 for devfs-outgoing; Wed, 28 Nov 2001 16:41:53 -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 fAT0ffo14590 for ; Wed, 28 Nov 2001 16:41:41 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fASNfeP22076; Wed, 28 Nov 2001 16:41:40 -0700 Date: Wed, 28 Nov 2001 16:41:40 -0700 Message-Id: <200111282341.fASNfeP22076@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Jeremy Brown Cc: Brad Chapman , Jeremy Brown , devfs@oss.sgi.com Subject: Re: alsa and devfs (maybe OT) In-Reply-To: <20011128152242.F286806@miine.engr.sgi.com> References: <20011128124819.X135812@miine.engr.sgi.com> <20011128225614.24725.qmail@web20410.mail.yahoo.com> <20011128152242.F286806@miine.engr.sgi.com> Sender: owner-devfs@oss.sgi.com Precedence: bulk Jeremy Brown writes: > On Wed, Nov 28, 2001 at 02:56:14PM -0800, Brad Chapman wrote: > [clip] > > > 3. Run one of the cute GUI mixers, like gmix or kmix, and turn up the > > > levels again. I have no idea why this is necessary, but it is on my > > > machines. > > > > I don't need to do that. I'm running ALSA 0.9.0beta9 in the non-kernel-patch > > form on top of 2.4.14. > > I think I have the same thing on one of my boxes - Mandrake 8.1, > 2.4.14 kernel, alsa 0.9beta9 (I think), devfs enabled... and I have to > run gmix or kmix before I get the devices. I haven't delved deep > enough in the source of gmix, kmix, alsamixer, and amixer to determine > what the former two seem to be touching that the latter two will not. devfsd /dev -d will run devfsd in protocol debug mode. You can see exactly what is being done to/with devfs. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Wed Nov 28 23:56:44 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAT7uiO03508 for devfs-outgoing; Wed, 28 Nov 2001 23:56:44 -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 fAT7ufo03504 for ; Wed, 28 Nov 2001 23:56:41 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAT6ude25982; Wed, 28 Nov 2001 23:56:39 -0700 Date: Wed, 28 Nov 2001 23:56:39 -0700 Message-Id: <200111290656.fAT6ude25982@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: pg_mh@sabi.Clara.co.UK (Piercarlo Grandi) Cc: Linux devfs Subject: Re: a bug(?), some requests/suggestions In-Reply-To: <15365.28305.826585.243408@home.sabi.co.UK> References: <15196.45808.642654.342681@home.sabi.co.UK> <200107310056.f6V0uMb13781@mobilix.ras.ucalgary.ca> <15365.28305.826585.243408@home.sabi.co.UK> Sender: owner-devfs@oss.sgi.com Precedence: bulk Piercarlo Grandi writes: > I have finally remembered about this; I have appended a copy of the > distributed 'devfsd.conf', with just the regular expressions made > tighter (anchored). OK, I like some of your changes, but I don't like the simple "^" for matching anything. I think ".*" is clearer. I've updated the file accordingly. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Nov 29 10:23:30 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fATINUY22805 for devfs-outgoing; Thu, 29 Nov 2001 10:23:30 -0800 Received: from ns.local.net (c1074691-a.saltlk1.ut.home.com [65.12.74.15]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fATINRo22802 for ; Thu, 29 Nov 2001 10:23:27 -0800 Received: by ns.local.net (Postfix, from userid 501) id 3BCB436B31; Thu, 29 Nov 2001 10:23:25 -0700 (MST) Received: from localhost (localhost [127.0.0.1]) by ns.local.net (Postfix) with ESMTP id 363E85DC39 for ; Thu, 29 Nov 2001 10:23:25 -0700 (MST) Date: Thu, 29 Nov 2001 10:23:25 -0700 (MST) From: Gary Shea X-X-Sender: shea@ns.local.net To: devfs@oss.sgi.com Subject: devfs/cdrom problem Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-devfs@oss.sgi.com Precedence: bulk I just installed Mandrake 8.1 (which comes with 2.4.8) on a P3 box, and am having trouble getting my ATAPI cdrom drive working with devfs. I'd never heard of devfs before -- elegant idea. The symptom is that the cd player doesn't work. Digging around, I found that there is a /dev/cdrom link to /dev/cdroms/cdrom0, but the latter has major number 11, so it's a SCSI cdrom device. It should be 22 of course, hdc. At least that's what I'd expect! I tried upgrading to kernel 2.4.13 which did not help. I discovered the append directive " hdc=ide-scsi" in lilo.conf (what the hell is that doing in there?!), but taking it out (and running lilo) didn't change anything on reboot. The kernel is booting with devfs=mount, and I'm frankly afraid to take it off. devfsd is running (if that's at all relevant). Any ideas? I'm frankly stumped! Gary From owner-devfs@oss.sgi.com Thu Nov 29 10:59:31 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fATIxVs23556 for devfs-outgoing; Thu, 29 Nov 2001 10:59: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 fATIxQo23553 for ; Thu, 29 Nov 2001 10:59:26 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fATHxUf31906; Thu, 29 Nov 2001 10:59:30 -0700 Date: Thu, 29 Nov 2001 10:59:30 -0700 Message-Id: <200111291759.fATHxUf31906@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Gary Shea Cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem In-Reply-To: References: Sender: owner-devfs@oss.sgi.com Precedence: bulk Gary Shea writes: > I just installed Mandrake 8.1 (which comes with 2.4.8) on a P3 box, and > am having trouble getting my ATAPI cdrom drive working with devfs. I'd > never heard of devfs before -- elegant idea. > > The symptom is that the cd player doesn't work. Digging around, I > found that there is a /dev/cdrom link to /dev/cdroms/cdrom0, but the > latter has major number 11, so it's a SCSI cdrom device. It should > be 22 of course, hdc. At least that's what I'd expect! Why should it be 22? You should be able to use an ATAPI CD-ROM via the sr_mod and ide-scsi drivers, which would give you major 11 devices. > I tried upgrading to kernel 2.4.13 which did not help. That's old. Try 2.4.16 instead. > I discovered the append directive " hdc=ide-scsi" in lilo.conf (what > the hell is that doing in there?!), but taking it out (and running > lilo) didn't change anything on reboot. If your ide drivers are loaded as modules, then the boot option won't have any effect in any case. You would need the following line in your /etc/modules.conf file: options ide-mod options="hcd=scsi" > The kernel is booting with devfs=mount, and I'm frankly afraid to > take it off. devfsd is running (if that's at all relevant). I don't think this is a devfs problem. You may have a device that doesn't work properly with ide-scsi. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Nov 29 15:00:50 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fATN0op10065 for devfs-outgoing; Thu, 29 Nov 2001 15:00:50 -0800 Received: from ns.local.net (c1074691-a.saltlk1.ut.home.com [65.12.74.15]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fATN0jo10062 for ; Thu, 29 Nov 2001 15:00:45 -0800 Received: by ns.local.net (Postfix, from userid 501) id 2343D36B3A; Thu, 29 Nov 2001 15:00:43 -0700 (MST) Received: from localhost (localhost [127.0.0.1]) by ns.local.net (Postfix) with ESMTP id 1F91A5DC3B for ; Thu, 29 Nov 2001 15:00:43 -0700 (MST) Date: Thu, 29 Nov 2001 15:00:43 -0700 (MST) From: Gary Shea X-X-Sender: shea@ns.local.net Cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem In-Reply-To: <200111291759.fATHxUf31906@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 Richard Gooch (rgooch@ras.ucalgary.ca) wrote: > Gary Shea writes: > > I just installed Mandrake 8.1 (which comes with 2.4.8) on a P3 box, and > > am having trouble getting my ATAPI cdrom drive working with devfs. I'd > > never heard of devfs before -- elegant idea. > > > > The symptom is that the cd player doesn't work. Digging around, I > > found that there is a /dev/cdrom link to /dev/cdroms/cdrom0, but the > > latter has major number 11, so it's a SCSI cdrom device. It should > > be 22 of course, hdc. At least that's what I'd expect! > > Why should it be 22? You should be able to use an ATAPI CD-ROM via the > sr_mod and ide-scsi drivers, which would give you major 11 devices. > [...] > > I don't think this is a devfs problem. You may have a device that > doesn't work properly with ide-scsi. Ok, that makes sense. I've never used ide-scsi. I've now tried this with two different atapi cdroms, one of which is a brand new burner, the other a cd/dvd drive, and neither are bottom of the barrel junk. In both cases the drives get mapped to (11,0), and cannot be mounted/played. I haven't tried a vanilla cdrom yet. I wouldn't be surprised if this has to do with Mandrake's distribution as a few others are reporting the same problem, but unless I want to rebuild the machine (again...), I have to live with it. 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 understand why the ide cdroms should be run through the scsi driver anyway, and since they don't work there, I'd just as soon avoid it. The ide drivers are in the kernel, not modules, and I've already tried append " hdc=cdrom" in lilo to no avail. Cheers, Gary From owner-devfs@oss.sgi.com Thu Nov 29 15:14:52 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fATNEql10434 for devfs-outgoing; Thu, 29 Nov 2001 15:14:52 -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 fATNEno10426 for ; Thu, 29 Nov 2001 15:14:50 -0800 Received: from marc.odradek.net ([24.200.140.100]) by VL-MS-MR003.sc1.videotron.ca (Netscape Messaging Server 4.15 MR003 Jul 24 2001 16:23:26) with SMTP id GNL1SO02.8D9 for ; Thu, 29 Nov 2001 17:14:48 -0500 Date: Thu, 29 Nov 2001 17:14:47 -0500 From: Marc Lavallée To: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem Message-Id: <20011129171447.286e26c1.odradek@videotron.ca> In-Reply-To: References: <200111291759.fATHxUf31906@vindaloo.ras.ucalgary.ca> X-Mailer: Sylpheed version 0.6.5 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-devfs@oss.sgi.com Precedence: bulk On Thu, 29 Nov 2001 15:00:43 -0700 (MST) Gary Shea wrote: > 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 have a similar problem, and the workaround is to rebuild the symbolic links at the end of the /etc/rc.d/rc.local startup script (my cdrom is a scsi burner): rm -rf /dev/cdrom* ln -s /dev/scsi/host0/bus0/target4/lun0/cd /dev/cdrom -- Marc From owner-devfs@oss.sgi.com Thu Nov 29 15:32:17 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fATNWHt10862 for devfs-outgoing; Thu, 29 Nov 2001 15:32: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 fATNWAo10855 for ; Thu, 29 Nov 2001 15:32:11 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fATMW0v02889; Thu, 29 Nov 2001 15:32:00 -0700 Date: Thu, 29 Nov 2001 15:32:00 -0700 Message-Id: <200111292232.fATMW0v02889@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Gary Shea Cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem In-Reply-To: References: <200111291759.fATHxUf31906@vindaloo.ras.ucalgary.ca> Sender: owner-devfs@oss.sgi.com Precedence: bulk Gary Shea writes: > Richard Gooch (rgooch@ras.ucalgary.ca) wrote: > > Gary Shea writes: > > > I just installed Mandrake 8.1 (which comes with 2.4.8) on a P3 box, and > > > am having trouble getting my ATAPI cdrom drive working with devfs. I'd > > > never heard of devfs before -- elegant idea. > > > > > > The symptom is that the cd player doesn't work. Digging around, I > > > found that there is a /dev/cdrom link to /dev/cdroms/cdrom0, but the > > > latter has major number 11, so it's a SCSI cdrom device. It should > > > be 22 of course, hdc. At least that's what I'd expect! > > > > Why should it be 22? You should be able to use an ATAPI CD-ROM via the > > sr_mod and ide-scsi drivers, which would give you major 11 devices. > > > [...] > > > > I don't think this is a devfs problem. You may have a device that > > doesn't work properly with ide-scsi. > > Ok, that makes sense. I've never used ide-scsi. > > I've now tried this with two different atapi cdroms, one of which is a > brand new burner, the other a cd/dvd drive, and neither are bottom of > the barrel junk. In both cases the drives get mapped to (11,0), and > cannot be mounted/played. I haven't tried a vanilla cdrom yet. > > I wouldn't be surprised if this has to do with Mandrake's distribution as > a few others are reporting the same problem, but unless I want to > rebuild the machine (again...), I have to live with it. > > 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 > understand why the ide cdroms should be run through the scsi driver > anyway, and since they don't work there, I'd just as soon avoid it. > The ide drivers are in the kernel, not modules, and I've already tried > append " hdc=cdrom" > in lilo to no avail. Did you take out the "hdc=ide-scsi" boot line? Something (not devfs) is causing your ATAPI CD-ROM to be managed by the ide-scsi driver, rather than the ide-cd driver. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Nov 29 16:53:41 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAU0rfC13247 for devfs-outgoing; Thu, 29 Nov 2001 16:53:41 -0800 Received: from ns.local.net (c1074691-a.saltlk1.ut.home.com [65.12.74.15]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAU0rZo13244 for ; Thu, 29 Nov 2001 16:53:36 -0800 Received: by ns.local.net (Postfix, from userid 501) id B04FB36B3A; Thu, 29 Nov 2001 16:53:34 -0700 (MST) Received: from localhost (localhost [127.0.0.1]) by ns.local.net (Postfix) with ESMTP id 9F7D95DC3C; Thu, 29 Nov 2001 16:53:34 -0700 (MST) Date: Thu, 29 Nov 2001 16:53:34 -0700 (MST) From: Gary Shea X-X-Sender: shea@ns.local.net To: Richard Gooch Cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem In-Reply-To: <200111292232.fATMW0v02889@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 Richard Gooch (rgooch@ras.ucalgary.ca) wrote: > Did you take out the "hdc=ide-scsi" boot line? Yeah, removing it had no effect. That was hours ago ;) > Something (not devfs) is causing your ATAPI CD-ROM to be managed by > the ide-scsi driver, rather than the ide-cd driver. Ok, this critter seems to be under control. The trick that seems to have done it was deleting the cdrom link, cdroms directory, and other scsi paraphernalia from the /lib/dev-state directory. I figured maybe devfs was dutifully recreating them just like the /dev/hdc I created with mknod. When devfs recreated the cdrom* stuff, /dev/cdroms/cdrom0 was a link down into the /dev/ide directory, and the cdrom works again. Bizarre. Still doesn't really make sense to me. If there's anything I can do to help turn this into a bug fix let me know, but it's probably pretty old code... Gary From owner-devfs@oss.sgi.com Thu Nov 29 16:59:31 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAU0xVt13378 for devfs-outgoing; Thu, 29 Nov 2001 16:59: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 fAU0xRo13375 for ; Thu, 29 Nov 2001 16:59:28 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fATNxJI03851; Thu, 29 Nov 2001 16:59:19 -0700 Date: Thu, 29 Nov 2001 16:59:19 -0700 Message-Id: <200111292359.fATNxJI03851@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Gary Shea Cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem In-Reply-To: References: <200111292232.fATMW0v02889@vindaloo.ras.ucalgary.ca> Sender: owner-devfs@oss.sgi.com Precedence: bulk Gary Shea writes: > Richard Gooch (rgooch@ras.ucalgary.ca) wrote: > > Did you take out the "hdc=ide-scsi" boot line? > > Yeah, removing it had no effect. That was hours ago ;) > > > Something (not devfs) is causing your ATAPI CD-ROM to be managed by > > the ide-scsi driver, rather than the ide-cd driver. > > Ok, this critter seems to be under control. The trick that seems to > have done it was deleting the cdrom link, cdroms directory, and > other scsi paraphernalia from the /lib/dev-state directory. I > figured maybe devfs was dutifully recreating them just like the > /dev/hdc I created with mknod. When devfs recreated the cdrom* > stuff, /dev/cdroms/cdrom0 was a link down into the /dev/ide > directory, and the cdrom works again. Ah. Perhaps your system boot scripts copy the state from /lib/dev-state into /dev. That's actually unwise, since there is no distinction between devfs/devfsd created inodes and normal process created inodes. It would be interesting to know if this indiscriminate copying is actually happening. It would be nice to know what the problem was. I'm currently finishing off the persistence management in devfsd, which will do this stuff properly. It will require v1.2 of the devfs core (already in kernel 2.4.17-pre1). Expect a new version of devfsd soon. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Nov 29 17:06:42 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAU16gs13688 for devfs-outgoing; Thu, 29 Nov 2001 17:06:42 -0800 Received: from ns.local.net (c1074691-a.saltlk1.ut.home.com [65.12.74.15]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAU16co13684 for ; Thu, 29 Nov 2001 17:06:38 -0800 Received: by ns.local.net (Postfix, from userid 501) id C2BE236B3A; Thu, 29 Nov 2001 17:06:37 -0700 (MST) Received: from localhost (localhost [127.0.0.1]) by ns.local.net (Postfix) with ESMTP id BF20A5DC3C; Thu, 29 Nov 2001 17:06:37 -0700 (MST) Date: Thu, 29 Nov 2001 17:06:37 -0700 (MST) From: Gary Shea X-X-Sender: shea@ns.local.net To: Richard Gooch Cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem In-Reply-To: <200111292232.fATMW0v02889@vindaloo.ras.ucalgary.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by oss.sgi.com id fAU16do13685 Sender: owner-devfs@oss.sgi.com Precedence: bulk On a slightly different topic, I was reading some old mails, and found this in the linux kernel list (as I recall...): ---------- From: Richard Gooch (rgooch@ras.ucalgary.ca) Date: Sun Jul 02 2000 - 13:23:57 EST Rask Ingemann Lambertsen writes: > Den 02-Jul-00 10:54:55 skrev Xuan Baldauf følgende om "devfs: whereis > my ide-cdrom": > >Hello, > > >I have an IDE cdrom drive formerly known as /dev/hdc: > [cut] > >but it does not appear in the devfs namespace in > >linux-2.4.0-test2-ac2: > > >notebook2:/dev/ide/host0/bus1/target0/lun0 # dir > [cut] > > >So it is a bug? > > [...] Check /dev/ide/host1/bus0/target0/lun0 instead. Correct. Each IDE interface is a separate host. Thus the secondary is host1. --------- I read this and thought, ok, this makes sense. Only problem is, I now have exactly the same situation. My drive is /dev/hdc (or used to be), but now it's /dev/ide/host0/bus1/target0/lun0/cd. Note host0, not host1 (there's no host1 at all). Was this momentary confusion or am I totally missing something? Gary From owner-devfs@oss.sgi.com Thu Nov 29 17:14:29 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAU1ETu16017 for devfs-outgoing; Thu, 29 Nov 2001 17:14: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 fAU1ENo16012 for ; Thu, 29 Nov 2001 17:14:23 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAU0EKg04175; Thu, 29 Nov 2001 17:14:20 -0700 Date: Thu, 29 Nov 2001 17:14:20 -0700 Message-Id: <200111300014.fAU0EKg04175@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Gary Shea Cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem In-Reply-To: References: <200111292232.fATMW0v02889@vindaloo.ras.ucalgary.ca> Sender: owner-devfs@oss.sgi.com Precedence: bulk Gary Shea writes: > On a slightly different topic, I was reading some old mails, and found > this in the linux kernel list (as I recall...): > > ---------- > From: Richard Gooch (rgooch@ras.ucalgary.ca) > Date: Sun Jul 02 2000 - 13:23:57 EST > > Rask Ingemann Lambertsen writes: > > Den 02-Jul-00 10:54:55 skrev Xuan Baldauf følgende om "devfs: whereis > > my ide-cdrom": > > >Hello, > > > > >I have an IDE cdrom drive formerly known as /dev/hdc: > > [cut] > > >but it does not appear in the devfs namespace in > > >linux-2.4.0-test2-ac2: > > > > >notebook2:/dev/ide/host0/bus1/target0/lun0 # dir > > [cut] > > > > >So it is a bug? > > > > [...] Check /dev/ide/host1/bus0/target0/lun0 instead. > > > Correct. Each IDE interface is a separate host. Thus the secondary is > host1. > --------- > > I read this and thought, ok, this makes sense. Only problem is, I > now have exactly the same situation. My drive is /dev/hdc (or used > to be), but now it's /dev/ide/host0/bus1/target0/lun0/cd. Note > host0, not host1 (there's no host1 at all). Was this momentary > confusion or am I totally missing something? Hm. I've just checked on a 2.4.7 box, which has hda (master on primary interface) and hdc (master on secondary interface). hda is /dev/ide/host0/bus0/target0/lun0 hdc is /dev/ide/host0/bus1/target0/lun0 So either I was wrong, or something has changed. In any case, is something not working, or are you just surprised? Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Nov 29 17:16:30 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAU1GUg18959 for devfs-outgoing; Thu, 29 Nov 2001 17:16:30 -0800 Received: from jah.cs.unm.edu (mail@mail.cs.unm.edu [64.106.20.33]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAU1GQo18955 for ; Thu, 29 Nov 2001 17:16:26 -0800 Received: from gig-2.cs.unm.edu ([64.106.21.112] ident=yoh) by jah.cs.unm.edu with esmtp (Exim 3.12 #1) id 169bLs-0000zn-00; Thu, 29 Nov 2001 17:16:24 -0700 Date: Thu, 29 Nov 2001 17:16:22 -0700 (MST) From: Yaroslav Halchenko To: Gary Shea cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem CDRW In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-devfs@oss.sgi.com Precedence: bulk Sorry for intrusion, But I want to ask one small question which is pretty important for me. > > [...] Check /dev/ide/host1/bus0/target0/lun0 instead. > Correct. Each IDE interface is a separate host. Thus the secondary is > host1. > --------- > > I read this and thought, ok, this makes sense. Only problem is, I now > have exactly the same situation. My drive is /dev/hdc (or used to be), > but now it's /dev/ide/host0/bus1/target0/lun0/cd. I have a CD-writer installed but I have problem that it crashes when DMA is turned on for it. So I had to switch 'hdparm -d0 /dev/hdc' all the time then I reboot. When I installed new kernel 2.4.13 with automounted devfs I couldn't turn off dma, because there is no hdc and hdparm says that it doesn't work with other devices like: [earwax] /home/yoh # hdparm /dev/scsi/host0/bus0/target0/lun0/cd /dev/scsi/host0/bus0/target0/lun0/cd not supported by hdparm [earwax] /home/yoh # hdparm /dev/scsi/host0/bus0/target1/lun0/cd /dev/scsi/host0/bus0/target1/lun0/cd not supported by hdparm So I had to create a hdc 'by hand'. Is there a way to avoid all this? Thanx in advance for any hints Sincerely, Yaroslav From owner-devfs@oss.sgi.com Thu Nov 29 17:18:01 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAU1I1A19022 for devfs-outgoing; Thu, 29 Nov 2001 17:18:01 -0800 Received: from ns.local.net (c1074691-a.saltlk1.ut.home.com [65.12.74.15]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAU1Hvo19018 for ; Thu, 29 Nov 2001 17:17:57 -0800 Received: by ns.local.net (Postfix, from userid 501) id 044BD36B3A; Thu, 29 Nov 2001 17:17:55 -0700 (MST) Received: from localhost (localhost [127.0.0.1]) by ns.local.net (Postfix) with ESMTP id 00B995DC3C; Thu, 29 Nov 2001 17:17:55 -0700 (MST) Date: Thu, 29 Nov 2001 17:17:55 -0700 (MST) From: Gary Shea X-X-Sender: shea@ns.local.net To: Richard Gooch Cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem In-Reply-To: <200111292359.fATNxJI03851@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 Richard Gooch (rgooch@ras.ucalgary.ca) wrote: > Ah. Perhaps your system boot scripts copy the state from > /lib/dev-state into /dev. That's actually unwise, since there is no > distinction between devfs/devfsd created inodes and normal process > created inodes. It would be interesting to know if this indiscriminate > copying is actually happening. It would be nice to know what the > problem was. > > I'm currently finishing off the persistence management in devfsd, > which will do this stuff properly. It will require v1.2 of the devfs > core (already in kernel 2.4.17-pre1). Expect a new version of devfsd > soon. Ah, ok... I dug around a bit and found.... # copy /lib/dev-state before starting devfsd to avoid accidentally # triggering devfsd actions (like module loading) if [ -d /lib/dev-state ]; then cp -af /lib/dev-state/* /dev > /dev/null 2>&1 fi action "Running DevFs deamon" devfsd /dev if [ -f /etc/sysconfig/mouse ];then . /etc/sysconfig/mouse device=`echo $device | sed -e 's/psaux/misc\/psaux/' -e 's/ttyS\(.\)/tts\/\1/g'` if [ -n "$device" ]; then rm -f /dev/mouse ln -s /dev/$device /dev/mouse fi fi Yuck. So can I get rid of the copy or is there something to reckon with in the comment about 'triggering devfsd actions'? Sorry about the lame questions... I'm in over my head here. Cheers, Gary From owner-devfs@oss.sgi.com Thu Nov 29 17:20:28 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAU1KSo19098 for devfs-outgoing; Thu, 29 Nov 2001 17:20: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 fAU1KOo19093 for ; Thu, 29 Nov 2001 17:20:24 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAU0K8704312; Thu, 29 Nov 2001 17:20:08 -0700 Date: Thu, 29 Nov 2001 17:20:08 -0700 Message-Id: <200111300020.fAU0K8704312@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Yaroslav Halchenko Cc: Gary Shea , devfs@oss.sgi.com Subject: Re: devfs/cdrom problem CDRW In-Reply-To: References: Sender: owner-devfs@oss.sgi.com Precedence: bulk Yaroslav Halchenko writes: > Sorry for intrusion, > > But I want to ask one small question which is pretty important for me. > > > > [...] Check /dev/ide/host1/bus0/target0/lun0 instead. > > Correct. Each IDE interface is a separate host. Thus the secondary is > > host1. > > --------- > > > > I read this and thought, ok, this makes sense. Only problem is, I now > > have exactly the same situation. My drive is /dev/hdc (or used to be), > > but now it's /dev/ide/host0/bus1/target0/lun0/cd. > > I have a CD-writer installed but I have problem that it crashes when DMA > is turned on for it. So I had to switch 'hdparm -d0 /dev/hdc' all the > time then I reboot. > > When I installed new kernel 2.4.13 with automounted devfs I couldn't > turn off dma, because there is no hdc and hdparm says that it doesn't work > with other devices like: > [earwax] /home/yoh # hdparm /dev/scsi/host0/bus0/target0/lun0/cd > /dev/scsi/host0/bus0/target0/lun0/cd not supported by hdparm > [earwax] /home/yoh # hdparm /dev/scsi/host0/bus0/target1/lun0/cd > /dev/scsi/host0/bus0/target1/lun0/cd not supported by hdparm > > So I had to create a hdc 'by hand'. Is there a way to avoid all this? Yeah, don't use ide-scsi! Or perhaps look for a leaf node entry under /dev/ide which you can use. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Nov 29 17:23:33 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAU1NXO19191 for devfs-outgoing; Thu, 29 Nov 2001 17:23:33 -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 fAU1NRo19185 for ; Thu, 29 Nov 2001 17:23:28 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAU0NLd04410; Thu, 29 Nov 2001 17:23:21 -0700 Date: Thu, 29 Nov 2001 17:23:21 -0700 Message-Id: <200111300023.fAU0NLd04410@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Gary Shea Cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem In-Reply-To: References: <200111292359.fATNxJI03851@vindaloo.ras.ucalgary.ca> Sender: owner-devfs@oss.sgi.com Precedence: bulk Gary Shea writes: > Richard Gooch (rgooch@ras.ucalgary.ca) wrote: > > Ah. Perhaps your system boot scripts copy the state from > > /lib/dev-state into /dev. That's actually unwise, since there is no > > distinction between devfs/devfsd created inodes and normal process > > created inodes. It would be interesting to know if this indiscriminate > > copying is actually happening. It would be nice to know what the > > problem was. > > > > I'm currently finishing off the persistence management in devfsd, > > which will do this stuff properly. It will require v1.2 of the devfs > > core (already in kernel 2.4.17-pre1). Expect a new version of devfsd > > soon. > > Ah, ok... I dug around a bit and found.... > > # copy /lib/dev-state before starting devfsd to avoid accidentally > # triggering devfsd actions (like module loading) > if [ -d /lib/dev-state ]; then > cp -af /lib/dev-state/* /dev > /dev/null 2>&1 > fi > action "Running DevFs deamon" devfsd /dev > if [ -f /etc/sysconfig/mouse ];then > . /etc/sysconfig/mouse > device=`echo $device | sed -e 's/psaux/misc\/psaux/' -e > 's/ttyS\(.\)/tts\/\1/g'` > if [ -n "$device" ]; then > rm -f /dev/mouse > ln -s /dev/$device /dev/mouse > fi > fi > > Yuck. So can I get rid of the copy or is there something to reckon > with in the comment about 'triggering devfsd actions'? Sorry about > the lame questions... I'm in over my head here. The comment is saying that the copy is best done before starting devfsd, rather than afterwards. However, removing the copy code entirely is OK too (you might find some entries are no longer in /dev because they haven't been restored by this copy, but you know that anyway). Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Nov 29 23:39:40 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAU7der29697 for devfs-outgoing; Thu, 29 Nov 2001 23:39:40 -0800 Received: from jah.cs.unm.edu (mail@mail.cs.unm.edu [64.106.20.33]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAU7dZo29690 for ; Thu, 29 Nov 2001 23:39:35 -0800 Received: from gig-2.cs.unm.edu ([64.106.21.112] ident=yoh) by jah.cs.unm.edu with esmtp (Exim 3.12 #1) id 169hKg-0001sL-00; Thu, 29 Nov 2001 23:39:34 -0700 Date: Thu, 29 Nov 2001 23:39:33 -0700 (MST) From: Yaroslav Halchenko To: Richard Gooch cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem CDRW In-Reply-To: <200111300020.fAU0K8704312@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 > > turn off dma, because there is no hdc and hdparm says that it doesn't work > > with other devices like: > > [earwax] /home/yoh # hdparm /dev/scsi/host0/bus0/target0/lun0/cd > > /dev/scsi/host0/bus0/target0/lun0/cd not supported by hdparm > > So I had to create a hdc 'by hand'. Is there a way to avoid all this? > Yeah, don't use ide-scsi! Or perhaps look for a leaf node entry under > /dev/ide which you can use. I thought that SCSI compatibility driver is necessary for cdrw-drive to have burning programs work... I didn't check without it though... /dev/ide/... doesn't work - because I have scsi emulation - there is no cd device in the ide section anywhere Sincerely, Yaroslav From owner-devfs@oss.sgi.com Thu Nov 29 23:49:04 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAU7n4v29984 for devfs-outgoing; Thu, 29 Nov 2001 23:49: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 fAU7n0o29981 for ; Thu, 29 Nov 2001 23:49:00 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAU6me909469; Thu, 29 Nov 2001 23:48:40 -0700 Date: Thu, 29 Nov 2001 23:48:40 -0700 Message-Id: <200111300648.fAU6me909469@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: linux-kernel@vger.kernel.org, devfs-announce-list@vindaloo.ras.ucalgary.ca Subject: devfsd-v1.3.20 available Sender: owner-devfs@oss.sgi.com Precedence: bulk Hi, all. I've just released version 1.3.20 of my devfsd (devfs daemon) at: http://www.atnf.csiro.au/~rgooch/linux/ Tarball directly available from: ftp://ftp.??.kernel.org/pub/linux/daemons/devfsd/devfsd.tar.gz AND: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/daemons/devfsd/devfsd.tar.gz This works with devfs-patch-v130, kernel 2.3.46 and devfs-patch-v99.7 (or later). NOTE: this release finally provides complete permissions management. Manually (i.e. non driver or devfsd) created inodes can now be restored when devfsd starts up. This requires v1.2 of the devfs core (available in 2.4.17-pre1) for best operation. The main changes are: - COPY action now sets sticky bit as required - Added RESTORE directive. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Thu Nov 29 23:53:20 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAU7rK730155 for devfs-outgoing; Thu, 29 Nov 2001 23:53:20 -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 fAU7rHo30152 for ; Thu, 29 Nov 2001 23:53:17 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAU6rIT09602; Thu, 29 Nov 2001 23:53:18 -0700 Date: Thu, 29 Nov 2001 23:53:18 -0700 Message-Id: <200111300653.fAU6rIT09602@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Yaroslav Halchenko Cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem CDRW In-Reply-To: References: <200111300020.fAU0K8704312@vindaloo.ras.ucalgary.ca> Sender: owner-devfs@oss.sgi.com Precedence: bulk Yaroslav Halchenko writes: > > > turn off dma, because there is no hdc and hdparm says that it doesn't work > > > with other devices like: > > > [earwax] /home/yoh # hdparm /dev/scsi/host0/bus0/target0/lun0/cd > > > /dev/scsi/host0/bus0/target0/lun0/cd not supported by hdparm > > > So I had to create a hdc 'by hand'. Is there a way to avoid all this? > > Yeah, don't use ide-scsi! Or perhaps look for a leaf node entry under > > /dev/ide which you can use. > > I thought that SCSI compatibility driver is necessary for cdrw-drive > to have burning programs work... I didn't check without it though... Last I checked, that's correct. > /dev/ide/... doesn't work - because I have scsi emulation - there is > no cd device in the ide section anywhere OK. So if you need to use ide-scsi, then you can find your CD-ROM under /dev/cdroms. It should contain an entry pointing off to /dev/scsi/host*/bus*/target*/lun*/cd Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Fri Nov 30 01:01:00 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAU910131440 for devfs-outgoing; Fri, 30 Nov 2001 01:01:00 -0800 Received: from jah.cs.unm.edu (mail@mail.cs.unm.edu [64.106.20.33]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAU90so31435 for ; Fri, 30 Nov 2001 01:00:54 -0800 Received: from gig-2.cs.unm.edu ([64.106.21.112] ident=yoh) by jah.cs.unm.edu with esmtp (Exim 3.12 #1) id 169ibM-0003p6-00; Fri, 30 Nov 2001 01:00:52 -0700 Date: Fri, 30 Nov 2001 01:00:51 -0700 (MST) From: Yaroslav Halchenko To: Richard Gooch cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem CDRW In-Reply-To: <200111300653.fAU6rIT09602@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 Dear Richard, > > no cd device in the ide section anywhere > OK. So if you need to use ide-scsi, then you can find your CD-ROM > under /dev/cdroms. It should contain an entry pointing off to > /dev/scsi/host*/bus*/target*/lun*/cd It is not that hard to find it there, but as I said in the original message hdparm doesn't work with it (it seems it didn't work with sg* either without devfs). So problem is that hdparm doesn't work with scsi devices probably... So I need also access to hdc which is not going through SCSI emulation. Here is difference in requests for hdc and scsi/host0/bus0/target1/lun0/cd SCSI: 16882 stat("/dev/scsi/host0/bus0/target1/lun0/cd", {st_dev=makedev(0, 7), st_ino=1285, st_mode=S_IFBLK|0666, st_nlink=1, st _uid=0, st_gid=24, st_blksize=1024, st_blocks=0, st_rdev=makedev(11, 1), st_atime=0, st_mtime=0, st_ctime=2001/11/24-15:07: 29}) = 0 then it reports a problem as I mentioned IDE: 16893 stat("/dev/hdc", {st_dev=makedev(0, 7), st_ino=1360, st_mode=S_IFBLK|0660, st_nlink=1, st_uid=0, st_gid=6, st_blksize =1024, st_blocks=0, st_rdev=makedev(22, 0), st_atime=2001/11/24-15:10:39, st_mtime=2001/11/24-15:10:39, st_ctime=2001/11/24 -15:10:39}) = 0 16893 open("/dev/hdc", O_RDONLY|O_NONBLOCK) = 4 so it openes it without hesitation So is problem in major/minors? 22,0 vs 11,1 or something else? > > Regards, > > Richard.... > Permanent: rgooch@atnf.csiro.au > Current: rgooch@ras.ucalgary.ca > From owner-devfs@oss.sgi.com Fri Nov 30 09:44:20 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAUHiKf24264 for devfs-outgoing; Fri, 30 Nov 2001 09:44:20 -0800 Received: from ns.local.net (c1074691-a.saltlk1.ut.home.com [65.12.74.15]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAUHiFo24261 for ; Fri, 30 Nov 2001 09:44:15 -0800 Received: by ns.local.net (Postfix, from userid 501) id 8DC5B36B3D; Fri, 30 Nov 2001 09:44:13 -0700 (MST) Received: from localhost (localhost [127.0.0.1]) by ns.local.net (Postfix) with ESMTP id 8802D5DC3F; Fri, 30 Nov 2001 09:44:13 -0700 (MST) Date: Fri, 30 Nov 2001 09:44:13 -0700 (MST) From: Gary Shea X-X-Sender: shea@ns.local.net To: Richard Gooch Cc: devfs@oss.sgi.com Subject: Re: devfs/cdrom problem In-Reply-To: <200111300014.fAU0EKg04175@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 On Yesterday, Richard Gooch (rgooch@ras.ucalgary.ca) wrote: > Hm. I've just checked on a 2.4.7 box, which has hda (master on primary > interface) and hdc (master on secondary interface). > > hda is /dev/ide/host0/bus0/target0/lun0 > hdc is /dev/ide/host0/bus1/target0/lun0 > > So either I was wrong, or something has changed. > > In any case, is something not working, or are you just surprised? Just surprised, figured it was worth checking into. The machine is fully functional now with devfs, so I couldn't be happier. I like the devfs idea a lot, it seems like the right way to go. The devil, as usual, is in the details, like this hdparm thing... Thanks for your help -- I'll monitor the list for a bit in case any other Mandrake folks show up ;) Cheers, Gary From owner-devfs@oss.sgi.com Fri Nov 30 13:45:35 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAULjZw06878 for devfs-outgoing; Fri, 30 Nov 2001 13:45:35 -0800 Received: from tsv.sws.net.au (tsv.sws.net.au [203.36.46.2]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAULjRo06872 for ; Fri, 30 Nov 2001 13:45:27 -0800 Received: from lyta.coker.com.au (localhost [127.0.0.1]) by tsv.sws.net.au (Postfix) with ESMTP id 69698926EF for ; Sat, 1 Dec 2001 07:45:23 +1100 (EST) Received: from there (lyta [127.0.0.1]) by lyta.coker.com.au (Postfix) with SMTP id 74D7635FCA2 for ; Fri, 30 Nov 2001 21:45:15 +0100 (CET) Content-Type: text/plain; charset="us-ascii" From: Russell Coker Reply-To: Russell Coker To: devfs@oss.sgi.com Subject: default config for cdrom links Date: Fri, 30 Nov 2001 21:45:15 +0100 X-Mailer: KMail [version 1.3.2] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20011130204515.74D7635FCA2@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk 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 Also does the LOOKUP entry provide any benefit? -- http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/projects.html Projects I am working on http://www.coker.com.au/~russell/ My home page From owner-devfs@oss.sgi.com Fri Nov 30 13:56:18 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAULuIW09789 for devfs-outgoing; Fri, 30 Nov 2001 13:56:18 -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 fAULuEo09786 for ; Fri, 30 Nov 2001 13:56:14 -0800 Received: from proski by fencepost.gnu.org with local (Exim 3.22 #1 (Debian)) id 169uhg-0003oM-00; Fri, 30 Nov 2001 15:56:12 -0500 Date: Fri, 30 Nov 2001 15:56:12 -0500 (EST) From: Pavel Roskin X-X-Sender: To: , Richard Gooch Subject: Another patch for GNUmakefile to make rpm happy Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-devfs@oss.sgi.com Precedence: bulk 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. Here's the patch. It's sufficient to make rpm happy :-) -- Regards, Pavel Roskin --------------------------------------- --- GNUmakefile +++ GNUmakefile @@ -30,15 +30,15 @@ @if fgrep -q "Generic section: do not change" /etc/modules.conf ; then\ echo "First remove the generic devfs entries from /etc/modules.conf"; exit 1; \ fi - if [ ! -e $(SBINDIR) ]; then mkdir $(SBINDIR); fi + if [ ! -e $(SBINDIR) ]; then mkdir -p $(SBINDIR); fi rm -f $(SBINDIR)/devfsd install -s devfsd $(SBINDIR)/devfsd - if [ ! -e $(MANDIR)/man5 ]; then mkdir $(MANDIR)/man5; fi - if [ ! -e $(MANDIR)/man8 ]; then mkdir $(MANDIR)/man8; fi + if [ ! -e $(MANDIR)/man5 ]; then mkdir -p $(MANDIR)/man5; fi + if [ ! -e $(MANDIR)/man8 ]; then mkdir -p $(MANDIR)/man8; fi -rm -f $(MANDIR)/*/devfsd.* cp -p devfsd.8 $(MANDIR)/man8 cp -p devfsd.conf.5 $(MANDIR)/man5 - if [ ! -e $(CONFDIR) ]; then mkdir $(CONFDIR); fi + if [ ! -e $(CONFDIR) ]; then mkdir -p $(CONFDIR); fi if [ ! -e $(CONFIG_FILE) ]; then cp -p devfsd.conf $(CONFIG_FILE); fi @echo "Installing /etc/modules.devfs" @sed "s/DEVFSD-VERSION/`grep '#define DEVFSD_VERSION' version.h | cut -d'"' -f 2`/" modules.devfs > $(CONFDIR)/modules.devfs --------------------------------------- From owner-devfs@oss.sgi.com Fri Nov 30 15:29:57 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAUNTvv12532 for devfs-outgoing; Fri, 30 Nov 2001 15:29:57 -0800 Received: from ns.local.net (c1074691-a.saltlk1.ut.home.com [65.12.74.15]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAUNTqo12528 for ; Fri, 30 Nov 2001 15:29:52 -0800 Received: by ns.local.net (Postfix, from userid 501) id 7909D36B3F; Fri, 30 Nov 2001 15:29:49 -0700 (MST) Received: from localhost (localhost [127.0.0.1]) by ns.local.net (Postfix) with ESMTP id 7530A5DC40; Fri, 30 Nov 2001 15:29:49 -0700 (MST) Date: Fri, 30 Nov 2001 15:29:49 -0700 (MST) From: Gary Shea X-X-Sender: shea@ns.local.net To: Russell Coker Cc: devfs@oss.sgi.com Subject: Re: default config for cdrom links In-Reply-To: <20011130204515.74D7635FCA2@lyta.coker.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-devfs@oss.sgi.com Precedence: bulk Russell Coker (russell@coker.com.au) wrote: > 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 Interesting... in my Mandrake 8.1 distribution the directory name is right. Not very nice if they didn't propagate the fix back. Gary From owner-devfs@oss.sgi.com Fri Nov 30 15:39:36 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAUNdaJ12703 for devfs-outgoing; Fri, 30 Nov 2001 15:39:36 -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 fAUNdWo12700 for ; Fri, 30 Nov 2001 15:39:32 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAUMdJI19809; Fri, 30 Nov 2001 15:39:19 -0700 Date: Fri, 30 Nov 2001 15:39:19 -0700 Message-Id: <200111302239.fAUMdJI19809@vindaloo.ras.ucalgary.ca> From: Richard Gooch To: Gary Shea Cc: Russell Coker , devfs@oss.sgi.com Subject: Re: default config for cdrom links In-Reply-To: References: <20011130204515.74D7635FCA2@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk Gary Shea writes: > Russell Coker (russell@coker.com.au) wrote: > > 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 > > Interesting... in my Mandrake 8.1 distribution the directory name is > right. Not very nice if they didn't propagate the fix back. Please contact whoever is responsible in Mandrake for devfsd packaging and point out this oversight. I'll fix this for the next devfsd release. Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Fri Nov 30 15:47:30 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAUNlUh12872 for devfs-outgoing; Fri, 30 Nov 2001 15:47:30 -0800 Received: from tsv.sws.net.au (tsv.sws.net.au [203.36.46.2]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fAUNlQo12865 for ; Fri, 30 Nov 2001 15:47:26 -0800 Received: from lyta.coker.com.au (localhost [127.0.0.1]) by tsv.sws.net.au (Postfix) with ESMTP id 9FD33926EF; Sat, 1 Dec 2001 09:47:23 +1100 (EST) Received: from there (lyta [127.0.0.1]) by lyta.coker.com.au (Postfix) with SMTP id 97265231D; Fri, 30 Nov 2001 23:47:15 +0100 (CET) Content-Type: text/plain; charset="iso-8859-1" From: Russell Coker Reply-To: Russell Coker To: Richard Gooch Subject: Re: default config for cdrom links Date: Fri, 30 Nov 2001 23:47:15 +0100 X-Mailer: KMail [version 1.3.2] Cc: devfs@oss.sgi.com References: <20011130204515.74D7635FCA2@lyta.coker.com.au> <200111302239.fAUMdJI19809@vindaloo.ras.ucalgary.ca> In-Reply-To: <200111302239.fAUMdJI19809@vindaloo.ras.ucalgary.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20011130224715.97265231D@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk On Fri, 30 Nov 2001 23:39, Richard Gooch wrote: > Gary Shea writes: > > Russell Coker (russell@coker.com.au) wrote: > > > 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 > > > > Interesting... in my Mandrake 8.1 distribution the directory name is > > right. Not very nice if they didn't propagate the fix back. > > Please contact whoever is responsible in Mandrake for devfsd packaging > and point out this oversight. > > I'll fix this for the next devfsd release. I have to admit I fixed it a few versions ago for Debian... It was one of those things where I fixed it in response to a bug report late at night and didn't check whether I was fixing your mistake or my mistake in patching your sample code... -- http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/projects.html Projects I am working on http://www.coker.com.au/~russell/ My home page From owner-devfs@oss.sgi.com Fri Nov 30 15:58:21 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fAUNwLr13651 for devfs-outgoing; Fri, 30 Nov 2001 15:58:21 -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 fAUNwHo13648 for ; Fri, 30 Nov 2001 15:58:17 -0800 Received: (from rgooch@localhost) by vindaloo.ras.ucalgary.ca (8.10.0/8.10.0) id fAUMw5520062; Fri, 30 Nov 2001 15:58:05 -0700 Date: Fri, 30 Nov 2001 15:58:05 -0700 Message-Id: <200111302258.fAUMw5520062@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: <20011130224715.97265231D@lyta.coker.com.au> References: <20011130204515.74D7635FCA2@lyta.coker.com.au> <200111302239.fAUMdJI19809@vindaloo.ras.ucalgary.ca> <20011130224715.97265231D@lyta.coker.com.au> Sender: owner-devfs@oss.sgi.com Precedence: bulk Russell Coker writes: > On Fri, 30 Nov 2001 23:39, Richard Gooch wrote: > > Gary Shea writes: > > > Russell Coker (russell@coker.com.au) wrote: > > > > 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 > > > > > > Interesting... in my Mandrake 8.1 distribution the directory name is > > > right. Not very nice if they didn't propagate the fix back. > > > > Please contact whoever is responsible in Mandrake for devfsd packaging > > and point out this oversight. > > > > I'll fix this for the next devfsd release. > > I have to admit I fixed it a few versions ago for Debian... Regards, Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca From owner-devfs@oss.sgi.com Fri Nov 30 17:02:41 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id fB112fV14745 for devfs-outgoing; Fri, 30 Nov 2001 17:02:41 -0800 Received: from mta5.snfc21.pbi.net (mta5.snfc21.pbi.net [206.13.28.241]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id fB112eo14742 for ; Fri, 30 Nov 2001 17:02:40 -0800 Received: from Alan Vaughn.pacbell.net ([63.196.189.192]) by mta5.snfc21.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0GNN000N61GFDC@mta5.snfc21.pbi.net> for devfs@oss.sgi.com; Fri, 30 Nov 2001 16:02:39 -0800 (PST) Date: Fri, 30 Nov 2001 16:04:06 -0800 From: Alan and Vivian Vaughn Subject: Thanks and Apology X-Sender: avvaughn@postoffice.pacbell.net (Unverified) To: devfs@oss.sgi.com Message-id: <5.1.0.14.0.20011130160220.009e5640@postoffice.pacbell.net> MIME-version: 1.0 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Content-type: text/plain; format=flowed; charset=us-ascii Sender: owner-devfs@oss.sgi.com Precedence: bulk Your solution to use new headers worked. Thank you very much. I apologize for posting to the wrong list.