diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2010-12-09 08:02:35 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:36:21 -0500 |
commit | bb4379464efeb4624757e2cc0bf9207a309c1075 (patch) | |
tree | 0bbfa3e4da63315d2a1fe7b2709844716fcc7303 | |
parent | bf885f8a6772fb48409dd505a09d974a5e621f22 (diff) |
drbd: Another small enum drbd_state_rv cleanup
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index c116cbdc9dca..8088744d0ec1 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -2209,12 +2209,14 @@ static int drbd_asb_recover_1p(struct drbd_conf *mdev) __must_hold(local) | |||
2209 | case ASB_CALL_HELPER: | 2209 | case ASB_CALL_HELPER: |
2210 | hg = drbd_asb_recover_0p(mdev); | 2210 | hg = drbd_asb_recover_0p(mdev); |
2211 | if (hg == -1 && mdev->state.role == R_PRIMARY) { | 2211 | if (hg == -1 && mdev->state.role == R_PRIMARY) { |
2212 | self = drbd_set_role(mdev, R_SECONDARY, 0); | 2212 | enum drbd_state_rv rv2; |
2213 | |||
2214 | drbd_set_role(mdev, R_SECONDARY, 0); | ||
2213 | /* drbd_change_state() does not sleep while in SS_IN_TRANSIENT_STATE, | 2215 | /* drbd_change_state() does not sleep while in SS_IN_TRANSIENT_STATE, |
2214 | * we might be here in C_WF_REPORT_PARAMS which is transient. | 2216 | * we might be here in C_WF_REPORT_PARAMS which is transient. |
2215 | * we do not need to wait for the after state change work either. */ | 2217 | * we do not need to wait for the after state change work either. */ |
2216 | self = drbd_change_state(mdev, CS_VERBOSE, NS(role, R_SECONDARY)); | 2218 | rv2 = drbd_change_state(mdev, CS_VERBOSE, NS(role, R_SECONDARY)); |
2217 | if (self != SS_SUCCESS) { | 2219 | if (rv2 != SS_SUCCESS) { |
2218 | drbd_khelper(mdev, "pri-lost-after-sb"); | 2220 | drbd_khelper(mdev, "pri-lost-after-sb"); |
2219 | } else { | 2221 | } else { |
2220 | dev_warn(DEV, "Successfully gave up primary role.\n"); | 2222 | dev_warn(DEV, "Successfully gave up primary role.\n"); |
@@ -2252,11 +2254,13 @@ static int drbd_asb_recover_2p(struct drbd_conf *mdev) __must_hold(local) | |||
2252 | case ASB_CALL_HELPER: | 2254 | case ASB_CALL_HELPER: |
2253 | hg = drbd_asb_recover_0p(mdev); | 2255 | hg = drbd_asb_recover_0p(mdev); |
2254 | if (hg == -1) { | 2256 | if (hg == -1) { |
2257 | enum drbd_state_rv rv2; | ||
2258 | |||
2255 | /* drbd_change_state() does not sleep while in SS_IN_TRANSIENT_STATE, | 2259 | /* drbd_change_state() does not sleep while in SS_IN_TRANSIENT_STATE, |
2256 | * we might be here in C_WF_REPORT_PARAMS which is transient. | 2260 | * we might be here in C_WF_REPORT_PARAMS which is transient. |
2257 | * we do not need to wait for the after state change work either. */ | 2261 | * we do not need to wait for the after state change work either. */ |
2258 | self = drbd_change_state(mdev, CS_VERBOSE, NS(role, R_SECONDARY)); | 2262 | rv2 = drbd_change_state(mdev, CS_VERBOSE, NS(role, R_SECONDARY)); |
2259 | if (self != SS_SUCCESS) { | 2263 | if (rv2 != SS_SUCCESS) { |
2260 | drbd_khelper(mdev, "pri-lost-after-sb"); | 2264 | drbd_khelper(mdev, "pri-lost-after-sb"); |
2261 | } else { | 2265 | } else { |
2262 | dev_warn(DEV, "Successfully gave up primary role.\n"); | 2266 | dev_warn(DEV, "Successfully gave up primary role.\n"); |