On Tue, 2009-08-25 at 16:22 +0200, Florian Zumbiehl wrote: > > > > > 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. > > > > > > Because? > > > > > POSIX. > > More specifically? > > And anyhow, I thought we were talking about the Linux kernel?! > If you don't know why rename() might fail, you really shouldn't be mucking around with this kind of code. > > > > > > 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. > > > > > > Guess how I found out that it can not work. > > > > > I don't know, you haven't given any detail of any problems you've > > encountered. > > I haven't "encountered any problems", nor have I claimed to have > "encountered any problems". > > You stated that the codepath in udev-node.c for the case when a > device node does already exist was somehow there for the case > when udev races with devmapper. I noted that that codepath is not > of any use in such a case, and that your argument thus is invalid. > Since I wrote this code, and the code in devmapper, and have not only strenuously tested it; but have at least 18 million for whom it works every day, I'd argue that my argument is quite valid ;-) Scott -- Scott James Remnant scott@xxxxxxxxxxxxx
Attachment:
signature.asc
Description: This is a digitally signed message part