From: Sage Weil Date: Wed, 12 May 2010 03:56:31 +0000 (-0700) Subject: ceph: fix cap removal races X-Git-Tag: v2.6.34~27^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f818a73674c5d197f66b636a46d7d578d7258129;p=pandora-kernel.git ceph: fix cap removal races The iterate_session_caps helper traverses the session caps list and tries to grab an inode reference. However, the __ceph_remove_cap was clearing the inode backpointer _before_ removing itself from the session list, causing a null pointer dereference. Clear cap->ci under protection of s_cap_lock to avoid the race, and to tightly couple the list and backpointer state. Use a local flag to indicate whether we are releasing the cap, as cap->session may be modified by a racing thread in iterate_session_caps. Signed-off-by: Sage Weil --- Reading git-diff-tree failed