linux/fs/gfs2/locking/dlm
Bob Peterson 55c0c4ac0b [GFS2] GFS2: chmod hung - fix race in thread creation
The problem boiled down to a race between the gdlm_init_threads()
function initializing thread1 and its setting of blist = 1.
Essentially, "if (current == ls->thread1)" was checked by the thread
before the thread creator set ls->thread1.

Since thread1 is the only thread who is allowed to work on the
blocking queue, and since neither thread thought it was thread1, no one
was working on the queue.  So everything just sat.

This patch reuses the ls->async_lock spin_lock to fix the race,
and it fixes the problem.  I've done more than 2000 iterations of the
loop that was recreating the failure and it seems to work.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

--
2007-10-10 08:56:22 +01:00
..
lock_dlm.h [GFS2] Clean up duplicate includes in fs/gfs2/ 2007-10-10 08:54:44 +01:00
lock.c [GFS2] Reduce size of struct gdlm_lock 2007-07-09 08:22:21 +01:00
main.c [GFS2] make lock_dlm drop_count tunable in sysfs 2007-02-05 13:38:01 -05:00
Makefile [GFS2] Fix bug in Makefiles for lock modules 2006-09-27 12:20:06 -04:00
mount.c [DLM] variable allocation 2007-07-09 08:23:17 +01:00
plock.c [GFS2] use an temp variable to reduce a spin_unlock 2007-10-10 08:54:58 +01:00
sysfs.c remove "struct subsystem" as it is no longer needed 2007-05-02 18:57:59 -07:00
thread.c [GFS2] GFS2: chmod hung - fix race in thread creation 2007-10-10 08:56:22 +01:00