[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Locking of serial devices and devfs



On Thursday 21 June 2001 16:09, Wichert Akkerman wrote:
> Previously Cyrille Chepelov wrote:
> > ... until one uses a lean version of devfs, which doesn't have these
> > numbers, but just uses the pathname instead. Why design for a fragile
> > system ? Device names aren't going away.
>
> Using just names you loose since a single device can show up as
> multiple names.

True.  The current code is provably broken in the case of sym-links.  
/dev/modem is a very common sym-link.  The current ppp code will create 
LCK..modem for opening /dev/modem and LCK..ttyS0 for opening /dev/ttyS0, 
if /dev/modem is a sym-link to /dev/ttyS0 then you're stuffed.

We could have our locking programs de-reference sym-links before creating 
lock files, but that wouldn't work with hard links or multiple creations 
of nodes.  For example inserting a PCMCIA modem will create /dev/ttyS3 as 
well as having devfs create /dev/tts/3...

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



Reply to: