diff options
author | NeilBrown <neilb@suse.de> | 2009-12-14 12:49:46 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-12-14 12:49:46 +1100 |
commit | aa5cbd103887011b4830355f88fb055f9ad2d556 (patch) | |
tree | 92ef7c80999c6d0bfc6fef9a9cd3e4a75ee16c06 /drivers/md/md.h | |
parent | f40542532e96dda5506eb76badea322f2ae4731c (diff) |
md/bitmap: protect against bitmap removal while being updated.
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>
Cc: stable@kernel.org
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r-- | drivers/md/md.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index f184b69ef33..87430fea287 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -289,6 +289,7 @@ struct mddev_s * hot-adding a bitmap. It should * eventually be settable by sysfs. */ + struct mutex bitmap_mutex; struct list_head all_mddevs; }; |