summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-12-15 02:56:56 +0100
committerNeilBrown <neilb@suse.de>2015-02-03 22:35:52 +0100
commit5c675f83c68fbdf9c0e103c1090b06be747fa62c (patch)
tree9a03f84c7a3bcef7d5e757dc28ce7bd5d205b26a /drivers/md/raid10.h
parentmd: rename mddev->write_lock to mddev->lock (diff)
downloadlinux-5c675f83c68fbdf9c0e103c1090b06be747fa62c.tar.xz
linux-5c675f83c68fbdf9c0e103c1090b06be747fa62c.zip
md: make ->congested robust against personality changes.
There is currently no locking around calls to the 'congested' bdi function. If called at an awkward time while an array is being converted from one level (or personality) to another, there is a tiny chance of running code in an unreferenced module etc. So add a 'congested' function to the md_personality operations structure, and call it with appropriate locking from a central 'mddev_congested'. When the array personality is changing the array will be 'suspended' so no IO is processed. If mddev_congested detects this, it simply reports that the array is congested, which is a safe guess. As mddev_suspend calls synchronize_rcu(), mddev_congested can avoid races by included the whole call inside an rcu_read_lock() region. This require that the congested functions for all subordinate devices can be run under rcu_lock. Fortunately this is the case. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.h')
-rw-r--r--drivers/md/raid10.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/md/raid10.h b/drivers/md/raid10.h
index 157d69e83ff4..5ee6473ddc2c 100644
--- a/drivers/md/raid10.h
+++ b/drivers/md/raid10.h
@@ -150,7 +150,4 @@ enum r10bio_state {
*/
R10BIO_Previous,
};
-
-extern int md_raid10_congested(struct mddev *mddev, int bits);
-
#endif