Jun'ichi Nomura 844e8d904a [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))
        <the region is still marked dirty>
                                          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 <j-nomura@ce.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-09 16:39:09 -07:00
..
2005-09-07 18:44:33 -07:00
2005-07-30 09:47:53 -05:00
2005-09-09 13:57:48 -07:00
2005-09-07 17:17:33 -07:00
2005-09-06 17:52:54 -05:00
2005-09-07 16:57:17 -07:00
2005-04-16 15:20:36 -07:00
2005-09-08 01:45:47 -04:00
2005-09-06 22:15:20 -04:00
2005-09-09 13:57:27 -07:00
2005-06-21 18:46:32 -07:00
2005-04-16 15:20:36 -07:00
2005-08-29 17:02:17 -04:00