[lustre-devel] [PATCH 03/37] lustre: embed typ_kobj if obd_type

Simmons, James A. simmonsja at ornl.gov
Tue Feb 26 12:41:43 PST 2019


On Sun, Feb 24 2019, James Simmons wrote:

>> For some reason this patch didn't land in my mailbox but I can see it 
>> on https://patchwork.kernel.org/patch/10819037. This patch is mostly 
>> good since llite now uses dynamic_kobj_ktype with its own ktype. Thus 
>> class_sysfs_release() will never be called with llite.
>>
>> What does need fixing is
>>
>> --------------------------------------------------------
>> type->typ_kobj.kset = lustre_kset;
>>
>> changed to:
>>
>> type->typ_kobj.kset = kset_get(&lustre_kset);
>
>Why?  Where is the kset_put() what will match this?

Just an off the cuff review. I'm work on a full fledge patch.
Just testing on OpenSFS branch since the server side has
some unique needs. Basically in the old days the lov and osc
layer were present on servers so you have a /sys/fs/lustre/osc
tree on the MDS server for example. Now a new layer osp
has replaced it but we need to keep the old osc tree structure
around. The function part is some people test with everything
on one node which can create unique conditions to handle.
I'm trying to sort it out.

>> --------------------------------------------------------
>>
>> Next change needed it change all the
>>
>> kobject_put(&type->typ_kobj); -> kobject_del(&type->typ_kobj);
>>
>
>Why?
>kobject_del() removed from sysfs.  kobject_put() calls kobject_release()
>on the last put.  This calls kobject_cleanup() which calls kobject_del()
>if needed.
>So why do we need to call kobject_del()?

You are right. I missed that kobject_cleanup() calls kobject_del(). I noticed
It latter when you pointed out. 



More information about the lustre-devel mailing list