[PATCH v1] driver core: fix race between creating/querying glue dir and its cleanup

2016-07-10 Thread Ming Lei
The global mutex of 'gdp_mutex' is used to serialize creating/querying glue dir and its cleanup. Turns out it isn't a perfect way because part(kobj_kset_leave()) of the actual cleanup action() is done inside the release handler of the glue dir kobject. That means gdp_mutex has to be held before

[PATCH v1] driver core: fix race between creating/querying glue dir and its cleanup

2016-07-10 Thread Ming Lei
The global mutex of 'gdp_mutex' is used to serialize creating/querying glue dir and its cleanup. Turns out it isn't a perfect way because part(kobj_kset_leave()) of the actual cleanup action() is done inside the release handler of the glue dir kobject. That means gdp_mutex has to be held before