On Tue, 2009-08-25 at 14:21 +0200, Florian Zumbiehl wrote: > > > > reading some of the source of udev, I noticed what I would suspect to be a > > > [...] > > > > > > could someone possibly explain to me why there is that special codepath > > > for cases where the device node does already exist, so I can write a > > > patch that's not gonna break other functionality? > > > > > For example, when using devtmpfs; in which case the device nodes already > > exist. > > > > Or when updating devices like /dev/null which are created before udevd > > is started by the init script when not using devtmpfs. > > well, in those two cases always rename()ing the new node into place would > work, too!? That would be a different strategy than what's in > place at the moment, but it wouldn't need a special case!? > The rename() will fail. But you still need to apply any necessary ownership and mode changes. > > Or when racing with devmapper which creates /dev/mapper/foo devices at > > basically the same time as udev. > > Seriously? How is a piece of code that does the existence check and > the subsequent action depending on the result of that check non-atomically > supposed to help avoid some race condition resulting from possible > concurrent creation of a device node?! > Read the code and find out. It works. Scott -- Scott James Remnant scott@xxxxxxxxxxxxx
Attachment:
signature.asc
Description: This is a digitally signed message part