From: Jun'ichi Nomura Date: Fri, 9 Sep 2005 23:23:42 +0000 (-0700) Subject: [PATCH] dm: fix rh_dec()/rh_inc() race in dm-raid1.c X-Git-Tag: v2.6.14-rc1~253 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=844e8d904a7c1446e3f040683b4a0645c3eb168f;p=pandora-kernel.git [PATCH] dm: fix rh_dec()/rh_inc() race in dm-raid1.c Fix another bug in dm-raid1.c that the dirty region may stay in or be moved to clean list and freed while in use. It happens as follows: CPU0 CPU1 ------------------------------------------------------------------------------ rh_dec() if (atomic_dec_and_test(pending)) rh_inc() if the region is clean mark the region dirty and remove from clean list mark the region clean and move to clean list atomic_inc(pending) At this stage, the region is in clean list and will be mistakenly reclaimed by rh_update_states() later. Signed-off-by: Jun'ichi Nomura Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed