On 05/22/2014 11:05 AM, Jeff Mahoney wrote:
> - gpg control packet
> On 5/22/14, 8:19 AM, Chris Mason wrote:
>> Can we safely reinit a kobject that has been put in use in sysfs?
>> Given all the things that can hold refs etc is this legal?
> 
> It depends on how the kobject is being used.
> 
> It wouldn't be safe to re-use the kobject embedded in space_info since
> it controls the lifetime of the object, regardless of its use in sysfs.
> 
> The kobjects for block groups only exist for creating the
> subdirectories and their lifetime is actually the lifetime of the
> space_info. We take a reference to the space_info when we add them to
> sysfs because that's where they draw their data. The only reference to
> a block group kobject is taken when we add it to sysfs and is dropped
> when we remove it. Holding a sysfs file open doesn't pin the kobject,
> so once we remove it from sysfs (kobject_del waits for readers to
> complete), it's safe to reinitialize it.
> 

Fair enough, once you've tested this new patch a bit I'll drop mine for
yours.

Thanks!

-chris

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to