From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:48721 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752261AbcD2TJ6 (ORCPT ); Fri, 29 Apr 2016 15:09:58 -0400 Subject: Re: [PoC 2/7] Add kobject to super_block To: Al Viro References: <1461895282-4941-1-git-send-email-rgoldwyn@suse.de> <1461895282-4941-3-git-send-email-rgoldwyn@suse.de> <20160429022628.GX25498@ZenIV.linux.org.uk> Cc: linux-fsdevel@vger.kernel.org, Goldwyn Rodrigues From: Goldwyn Rodrigues Message-ID: <5723B182.4080705@suse.de> Date: Fri, 29 Apr 2016 14:09:54 -0500 MIME-Version: 1.0 In-Reply-To: <20160429022628.GX25498@ZenIV.linux.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 04/28/2016 09:26 PM, Al Viro wrote: > On Thu, Apr 28, 2016 at 09:01:17PM -0500, Goldwyn Rodrigues wrote: >> @@ -167,7 +204,8 @@ static void destroy_super(struct super_block *s) >> WARN_ON(!list_empty(&s->s_mounts)); >> kfree(s->s_subtype); >> kfree(s->s_options); >> - call_rcu(&s->rcu, destroy_super_rcu); >> + if (s->s_type->fs_flags & FS_CREATE_SYSFS) >> + kobject_del(&s->s_kobj); > > So we have kobject_del() under a spinlock. Wonderful... Better yet, > you have the sodding kobjects sitting around well past the point when > the filesystem driver has gone through rmmod. > > sysfs: lifetime rules made simple. So simple that they don't fit a lot of > situations, but hey - it sure *looks* easy to use... > > NAK. If you want a description of super_block life cycle, I can describe it > to you. But please, don't play with it until you understand it. > Yes, I understand what you are trying to say. Using kobject to destroy super_block does not make sense in the current scenario. Thanks for your feedback. -- Goldwyn