lkml.org 
[lkml]   [2013]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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


\
 
 \ /
  Last update: 2013-09-19 13:21    [W:0.122 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site