From: ebiederm@xmission.com (Eric W. Biederman)
To: Tejun Heo <tj@kernel.org>
Cc: gregkh@linuxfoundation.org, kay@vrfy.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCHSET] sysfs: implement sysfs_remove()
Date: Thu, 19 Sep 2013 05:48:52 -0500 [thread overview]
Message-ID: <87pps5dr3f.fsf@tw-ebiederman.twitter.com> (raw)
In-Reply-To: <1379538938-5032-1-git-send-email-tj@kernel.org> (Tejun Heo's message of "Wed, 18 Sep 2013 17:15:34 -0400")
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
next prev parent reply other threads:[~2013-09-19 10:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-18 21:15 [PATCHSET] sysfs: implement sysfs_remove() Tejun Heo
2013-09-18 21:15 ` [PATCH 1/4] sysfs: remove sysfs_addrm_cxt->parent_sd Tejun Heo
2013-09-18 21:15 ` [PATCH 2/4] kobject: grab an extra reference on kobject->sd to allow duplicate deletes Tejun Heo
2013-09-18 21:15 ` [PATCH 3/4] sysfs: make __sysfs_remove_dir() recursive Tejun Heo
2013-09-18 21:15 ` [PATCH 4/4] sysfs: introduce [__]sysfs_remove() Tejun Heo
2013-09-19 10:48 ` Eric W. Biederman [this message]
2013-09-19 12:38 ` [PATCHSET] sysfs: implement sysfs_remove() Tejun Heo
2013-09-19 17:03 ` Eric W. Biederman
2013-09-26 23:44 ` Greg KH
2013-09-27 13:49 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pps5dr3f.fsf@tw-ebiederman.twitter.com \
--to=ebiederm@xmission.com \
--cc=gregkh@linuxfoundation.org \
--cc=kay@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox