]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md/bitmap: protect against bitmap removal while being updated.
authorNeilBrown <neilb@suse.de>
Mon, 14 Dec 2009 01:49:46 +0000 (12:49 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 21:43:25 +0000 (13:43 -0800)
commitdaa991df23561fabbcbe1a6995f706de36a095ac
tree1487264ff459e8be14a4375c17bf3c56316bf299
parentb5939fce19ddfb6fd1edb613278d9b44d3f25e0a
md/bitmap: protect against bitmap removal while being updated.

commit aa5cbd103887011b4830355f88fb055f9ad2d556 upstream.

A write intent bitmap can be removed from an array while the
array is active.
When this happens, all IO is suspended and flushed before the
bitmap is removed.
However it is possible that bitmap_daemon_work is still running to
clear old bits from the bitmap.  If it is, it can dereference the
bitmap after it has been freed.

So introduce a new mutex to protect bitmap_daemon_work and get it
before destroying a bitmap.

This is suitable for any current -stable kernel.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/bitmap.c
drivers/md/bitmap.h
drivers/md/md.c
drivers/md/md.h