From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Subject: Re: [PATCH 25/20] sysfs: Only support removing emtpy sysfs directories. Date: Mon, 25 May 2009 00:44:26 -0700 Message-ID: References: <1243109591-21611-5-git-send-email-ebiederm@xmission.com> <1243169978.3502.7.camel@poy> <1243178448.4035.12.camel@poy> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Tejun Heo , Cornelia Huck , linux-fsdevel@vger.kernel.org, "Eric W. Biederman" , stern To: Kay Sievers Return-path: In-Reply-To: <1243178448.4035.12.camel@poy> (Kay Sievers's message of "Sun\, 24 May 2009 17\:20\:48 +0200") Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Kay Sievers writes: >> Let's make the plan to investigate these, and see how hard it would be >> to actually remove these with the current device/sysfs infrastructure. >> >> Fixing the users and adding back auto-deletion are the only two real options. > > Seems, we should remove non-directory files, which in most cases belong > to the kobject itself, but the user's cleanup logic does not cover the > removal of the created files. > > But I think, we should still warn, if we find a sub-directory inside a > directory we are going to remove. So far complaining about deleting non-empty directories is finding real bugs. It does not appear that too many users that delete non-empty directories. My plan moving forward is to see what has goofed and how hard it is to change the callers to clean up after themselves. If it is not a pain to fix the callers who forget to delete their attributes that looks like the right way forward. It is certainly the principle of least surprise. Eric