Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932439AbWCHHyM (ORCPT ); Wed, 8 Mar 2006 02:54:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932444AbWCHHyM (ORCPT ); Wed, 8 Mar 2006 02:54:12 -0500 Received: from mail.kroah.org ([69.55.234.183]:6539 "EHLO perch.kroah.org") by vger.kernel.org with ESMTP id S932439AbWCHHyM (ORCPT ); Wed, 8 Mar 2006 02:54:12 -0500 Date: Tue, 7 Mar 2006 23:53:42 -0800 From: Greg KH To: Maneesh Soni Cc: linux-kernel@vger.kernel.org, Patrick Mochel Subject: problem with duplicate sysfs directories and files Message-ID: <20060308075342.GA17718@kroah.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1133 Lines: 30 Hi, I spent some time tonight trying to track down how to fix the issue of duplicate sysfs files and/or directories. This happens when you try to create a kobject with the same name in the same directory. The creation of the second kobject will fail, but the directory will remain in sysfs. Now I know this isn't a normal operation, but it would be good to fix this eventually. I traced the issue down to fs/sysfs/dir.c:create_dir() and the check for: if (error && (error != -EEXIST)) { Problem is, error is set to -EEXIST, so we don't clean up properly. Now I know we can't just not check for this, as if you do that error cleanup, the original kobject's sysfs entry gets very messed up (ls -l does not like it at all...) But I can't seem to figure out what exactly we need to do to clean up properly here. Do you, or anyone else, have any pointers or ideas? thanks, greg k-h - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/