From: KaiGai Kohei Date: Thu, 29 Jun 2006 14:33:02 +0000 (+0100) Subject: [JFFS2][XATTR] Fix xd->refcnt race condition X-Git-Tag: v2.6.18-rc1~20^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6e8c6ccf96e9249805d0e9828b994f4c926ad51;p=pandora-kernel.git [JFFS2][XATTR] Fix xd->refcnt race condition When xd->refcnt is checked whether this xdatum should be released or not, atomic_dec_and_lock() is used to ensure holding the c->erase_completion_lock. This fix change a specification of delete_xattr_datum(). Previously, it's only called when xd->refcnt equals zero. (calling it with positive xd->refcnt cause a BUG()) If you applied this patch, the function checks whether xd->refcnt is zero or not under the spinlock if necessary. Then, it marks xd DEAD flahs and links with xattr_dead_list or releases it immediately when xd->refcnt become zero. Signed-off-by: KaiGai Kohei Signed-off-by: David Woodhouse --- Reading git-diff-tree failed