From: Andy Adamson Date: Mon, 20 Mar 2006 18:44:26 +0000 (-0500) Subject: locks,lockd: fix race in nlmsvc_testlock X-Git-Tag: v2.6.17-rc1~667^2~65 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8dc7c3115b611c00006eac3ee5b108296432aab7;p=pandora-kernel.git locks,lockd: fix race in nlmsvc_testlock posix_test_lock() returns a pointer to a struct file_lock which is unprotected and can be removed while in use by the caller. Move the conflicting lock from the return to a parameter, and copy the conflicting lock. In most cases the caller ends up putting the copy of the conflicting lock on the stack. On i386, sizeof(struct file_lock) appears to be about 100 bytes. We're assuming that's reasonable. Signed-off-by: Andy Adamson Signed-off-by: J. Bruce Fields Signed-off-by: Trond Myklebust --- Reading git-diff-tree failed