From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:56051 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752329AbcD2WpE (ORCPT ); Fri, 29 Apr 2016 18:45:04 -0400 Subject: Re: [PoC 0/7] Kobjectify filesystem To: Al Viro References: <1461895282-4941-1-git-send-email-rgoldwyn@suse.de> <1461951179.2619.5.camel@slavad-ubuntu-14.04> <5723A7B0.9080901@suse.de> <20160429223147.GZ25498@ZenIV.linux.org.uk> Cc: Viacheslav Dubeyko , linux-fsdevel@vger.kernel.org, Goldwyn Rodrigues From: Goldwyn Rodrigues Message-ID: <5723E3EC.6070200@suse.de> Date: Fri, 29 Apr 2016 17:45:00 -0500 MIME-Version: 1.0 In-Reply-To: <20160429223147.GZ25498@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/29/2016 05:31 PM, Al Viro wrote: > On Fri, Apr 29, 2016 at 01:28:00PM -0500, Goldwyn Rodrigues wrote: > >> Yes, you can register any attribute to sysfs, and most filesystems >> are doing exactly that. They maintain the kobject in their >> _super_block struct and use it to create /sys/fs// >> entries. So what I propose is this: > > [snip] > > What's really missing here is > > 0. carefully audit the existing sysfs users of that sort - they are _very_ > easy to get wrong, especially wrt lifetime issues and locking. As you have > demonstrated yourself in this patchset, BTW... > Agree. And I accept the way I have used the kobjects in this patchset is incorrect. I am reading on existing usage to get this right and have not yet completed my reading. Thank you for pointing me to the right direction. However, if you feel that it is absolutely infeasible to use kobjects at all in these fs structures with respect to lifetime and locking, please let me know the reason and I will stop my effort in this direction and think of alternative ways to do this. -- Goldwyn