Messages in this thread | | | From | (Eric W. Biederman) | Date | Thu, 19 Sep 2013 05:48:52 -0500 | Subject | Re: [PATCHSET] sysfs: implement sysfs_remove() |
| |
Tejun Heo <tj@kernel.org> writes:
> Hello, > > Currently, there are multiple variants of internal sysfs removal > functions and the directory removal behavior is a bit weird in that > while it does remove the files contained immediately in the directory > it wouldn't recurse into its subdirectories, even the group ones which > belong to the same kobject.
There are two very big problems with this direction. 1) It violates the principle of least surprise. In particular it messes up the mental model of people like Al Viro. Which can easily lead to code breaking during routine maintenance because of unexpecte semantics.
2) Recursive removal is not safe. There are very weird and somewhat pathological cases where sysfs directories are removed out of order aka parent before sibling, and (if my memory holds) recursive removal takes this from a little bit ugly to actually breaking things.
For long term maintenance and simplicity I believe we will be in much better shape if we take directory removal in the opposite direction, and fix the small number of issues with the users and don't support any kind of recursive removal.
Eric
| |