aboutsummaryrefslogtreecommitdiff
path: root/drivers/block/drbd/drbd_state.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-05-03 15:00:55 +0200
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 16:55:43 +0100
commitdaeda1cca91d58bb6c8e45f6734f021bab9c28b7 (patch)
tree002ba940efd64307f0805d6418634e2559f71363 /drivers/block/drbd/drbd_state.c
parent563e4cf25ec804eb02cd30a41baa2fcc6c06679b (diff)
downloadvexpress-lsk-daeda1cca91d58bb6c8e45f6734f021bab9c28b7.tar.gz
drbd: RCU for disk_conf
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_state.c')
-rw-r--r--drivers/block/drbd/drbd_state.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index 332781cfb55..cd55f46d5c5 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -483,13 +483,13 @@ is_valid_state(struct drbd_conf *mdev, union drbd_state ns)
enum drbd_state_rv rv = SS_SUCCESS;
struct net_conf *nc;
+ rcu_read_lock();
fp = FP_DONT_CARE;
if (get_ldev(mdev)) {
- fp = mdev->ldev->dc.fencing;
+ fp = rcu_dereference(mdev->ldev->disk_conf)->fencing;
put_ldev(mdev);
}
- rcu_read_lock();
nc = rcu_dereference(mdev->tconn->net_conf);
if (nc) {
if (!nc->two_primaries && ns.role == R_PRIMARY) {
@@ -674,7 +674,9 @@ static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state
fp = FP_DONT_CARE;
if (get_ldev(mdev)) {
- fp = mdev->ldev->dc.fencing;
+ rcu_read_lock();
+ fp = rcu_dereference(mdev->ldev->disk_conf)->fencing;
+ rcu_read_unlock();
put_ldev(mdev);
}
@@ -1132,7 +1134,9 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
fp = FP_DONT_CARE;
if (get_ldev(mdev)) {
- fp = mdev->ldev->dc.fencing;
+ rcu_read_lock();
+ fp = rcu_dereference(mdev->ldev->disk_conf)->fencing;
+ rcu_read_unlock();
put_ldev(mdev);
}
@@ -1287,7 +1291,9 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
/* corresponding get_ldev was in __drbd_set_state, to serialize
* our cleanup here with the transition to D_DISKLESS,
* so it is safe to dreference ldev here. */
- eh = mdev->ldev->dc.on_io_error;
+ rcu_read_lock();
+ eh = rcu_dereference(mdev->ldev->disk_conf)->on_io_error;
+ rcu_read_unlock();
was_io_error = test_and_clear_bit(WAS_IO_ERROR, &mdev->flags);
/* current state still has to be D_FAILED,