[lustre-devel] [PATCH v2] lustre: mdc: fix possible deadlock in chlg_open()
neilb at suse.com
Mon Nov 5 19:11:54 PST 2018
On Mon, Nov 05 2018, quentin.bouget at cea.fr wrote:
> Le 04/11/2018 à 22:34, James Simmons a écrit :
>>> Lockdep reports a possible deadlock between chlg_open() and
>>> mdc_changelog_cdev_init() takes chlg_registered_dev_lock and then
>>> calls misc_register() which takes misc_mtx.
>>> chlg_open() is called while misc_mtx is held, and tries to take
>>> If these two functions race, a deadlock can occur as each thread will
>>> hold one of the locks while trying to take the other.
>>> chlg_open() does not need to take a lock. It only uses the
>>> lock to stablize a list while looking for the matching
>>> chlg_registered_dev, and this can be found directly by examining
>>> So remove chlg_obd_get(), and use file->private_data to find the
>>> Also ensure the device is fully initialized before calling
>>> misc_register(). This means setting up some list linkage before the
>>> call, and tearing it down if there is an error.
>> I have been testing this but I'm no HSM expert. I pushed this patch
>> to OpenSFS branch as well.
>> Reviewed-by: James Simmons <jsimmons at infradead.org>
> Reviewed-by: Quentin Bouget <quentin.bouget at cea.fr>
Thanks to you both for the review.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 832 bytes
Desc: not available
More information about the lustre-devel