Re: [PATCH] race condition fixing in sysfs_create_dir

2013-07-30 Thread Tejun Heo
Hello, On Tue, Jul 30, 2013 at 02:34:56PM +0800, Dennis Chen wrote: > >I don't think sysfs is supposed to handle multiple actors trying to > >populate and destroy the directory at the same time at all, so this > >seems kinda moot. Do you have a case where this actually matters? > > hello,Tejun. N

Re: [PATCH] race condition fixing in sysfs_create_dir

2013-07-29 Thread Dennis Chen
On 07/26/2013 09:38 PM, Tejun Heo wrote: Hello, On Fri, Jul 26, 2013 at 05:59:00PM +0800, Dennis Chen wrote: On 07/26/2013 05:49 PM, Dennis Chen wrote: The patch is trying its best to avoid creating a dir under a parent dir which is removing from the system: PATH0 (create a dir under 'P

Re: [PATCH] race condition fixing in sysfs_create_dir

2013-07-26 Thread Tejun Heo
On Fri, Jul 26, 2013 at 09:38:56AM -0400, Tejun Heo wrote: > I don't think sysfs is supposed to handle multiple actors trying to > populate and destroy the directory at the same time at all, so this e.g. kobj->sd assignment in sysfs_create_dir() isn't synchronized and doesn't have memory barrier e

Re: [PATCH] race condition fixing in sysfs_create_dir

2013-07-26 Thread Tejun Heo
Hello, On Fri, Jul 26, 2013 at 05:59:00PM +0800, Dennis Chen wrote: > On 07/26/2013 05:49 PM, Dennis Chen wrote: > > >The patch is trying its best to avoid creating a dir under a parent dir > >which is removing from > >the system: > > PATH0 (create a dir under 'PARENT/...') PATH1 (re

Re: [PATCH] race condition fixing in sysfs_create_dir

2013-07-26 Thread Dennis Chen
On 07/26/2013 05:49 PM, Dennis Chen wrote: The patch is trying its best to avoid creating a dir under a parent dir which is removing from the system: PATH0 (create a dir under 'PARENT/...') PATH1 (remove the 'PARENT/...') sysfs_create_dir() { sysf

[PATCH] race condition fixing in sysfs_create_dir

2013-07-26 Thread Dennis Chen
The patch is trying its best to avoid creating a dir under a parent dir which is removing from the system: PATH0 (create a dir under 'PARENT/...') PATH1 (remove the 'PARENT/...') sysfs_create_dir() { sysfs_remove_dir() { ...