Re: [BUG] sysfs on 2.5.48 unable to remove files while in use

Werner Almesberger (wa@almesberger.net)
Mon, 25 Nov 2002 16:13:52 -0300


Patrick Mochel wrote:
> The difference is that sysfs directories are tied to kobjects. By writing
> to the file with the specific syntax, you are telling the module to create
> an object with the parameters you give. Once the object is registered, a
> directory is created for it, and it's only removed when the object is
> unregistered. We don't just randomly create directories.

Yes, and I think that's perfect. All I'm suggesting is to use
mkdir/rmdir to make the creation/removal request, and then use
whatever is convenient for ensuring that things stay unique (i.e.
resolve it either at the VFS, kprobes, or "glue" level).

I fully agree that creating interrelated objects at two distinct
places in the kernel and then trying to "synchronize" them leads
to madness. (*)

(*) Actually, someone in academia who works with protocol
validations, and has a bit too much time on his or her hands,
should once try to find an elegant way of linking this type of
in-kernel dependencies to a validation tool like Spin.

Right now, the process for validating such a mess is still to
abstract the design into a model in a language like Promela
(very slick, but decidedly "alien"), SyncC++ (C-ish, but still
too far from real kernel code), etc., and to validate the
model.

I've done this on some occasions (and discovered interesting
bugs in the process), but the pain threshold required is a bit
too high to suggest this as a general procedure.

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         wa@almesberger.net /
/_http://www.almesberger.net/____________________________________________/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/