cluster/dlm-kernel/src lockspace.c

teigland@sourceware.org teigland@sourceware.org
Sat Mar 26 04:43:00 GMT 2005


CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	teigland@sourceware.org	2005-03-26 04:43:51

Modified files:
	dlm-kernel/src : lockspace.c 

Log message:
	On Fri, Mar 25, 2005 at 03:22:38PM -0800, Daniel McNeil wrote:
	
	Looking at the code, the problem is a race condition between
	dlm_astd() and release_lockspace().  dlm_astd can pull an
	lkb off the ast_queue and still be processing it while the
	release_lockspace() is running calls dlm_dir_clear() and
	then kfree()s ls->ls_dirtbl.  When dlm_astd() calls
	release_rsb() it leads to a dlm_dir_remove() which accesses
	the freed ls_dirtbl which is freed.  With slab debug, this
	leads a spinning write_lock() and a hung umount.  My machines
	are 2 cpu systems which also might expose the race condition.
	
	The fix is below and is fairly simple, just do the astd_suspend()
	in release_lockspace() before the dlm_dir_clear() and kfree().
	That way astd won't be process lkb on the astqueue will it
	is being freed.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/cluster/dlm-kernel/src/lockspace.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.19.2.5&r2=1.19.2.6



More information about the Cluster-cvs mailing list