From: ebiederm@xmission.com (Eric W. Biederman) Subject: Re: [PATCH 04/20] sysfs: Handle the general case of removing of directories with subdirectories Date: Thu, 21 May 2009 02:18:40 -0700 Message-ID: References: <1242865694-2100-1-git-send-email-ebiederm@xmission.com> <1242865694-2100-2-git-send-email-ebiederm@xmission.com> <1242865694-2100-3-git-send-email-ebiederm@xmission.com> <1242865694-2100-4-git-send-email-ebiederm@xmission.com> <4A14F356.3030501@kernel.org> <4A15046A.10106@kernel.org> <4A1512E2.2040505@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Cornelia Huck , linux-fsdevel@vger.kernel.org, "Eric W. Biederman" To: Tejun Heo Return-path: Received: from out01.mta.xmission.com ([166.70.13.231]:56380 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbZEUJSq (ORCPT ); Thu, 21 May 2009 05:18:46 -0400 In-Reply-To: <4A1512E2.2040505@kernel.org> (Tejun Heo's message of "Thu\, 21 May 2009 17\:37\:54 +0900") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Tejun Heo writes: > Well, it can be trivially fixed by checking the removed flag. The > add/rm thing is designed to help additions and removals of multiple > nodes at one go and I'd really like to see it working that way. Any > chance you can change code toward that direction? Yes. We definitely need to check the removed flag in sysfs_add_one. Regardless of anything else. I need to sleep on this but I am inclined to get rid of the rest of the complications simply by failing the removal of non-empty directories. Going through the upper layers and making them properly responsible for their actions. I am afraid friendlier in this circumstance might equate to easier to misuse and let code bugs pile up. Eric