summaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_state.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2012-09-03 15:39:01 +0200
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-09 14:11:38 +0100
commita3025a273700fc51dd561c7b2941f3c9db9be90a (patch)
treee4fc182421eb57b8863c3ba0aa4b6c2fa6e975ef /drivers/block/drbd/drbd_state.c
parentdrbd: Remove duplicate code (diff)
downloadlinux-a3025a273700fc51dd561c7b2941f3c9db9be90a.tar.xz
linux-a3025a273700fc51dd561c7b2941f3c9db9be90a.zip
drbd: Fix comparison of is_valid_transition()'s return code
is_valid_transition() might return SS_NOTHING_TO_DO. The condition function _req_st_cond() returned SS_NOTHING_TO_DO, which caused the wait_event to abort too early. Therefore drbd_req_state() did not consume the next CL_ST_CHG_SUCCESS or SS_CW_FAILED_BY_PEER causing serve disruption of the state machine logic... Detaching from a single volue was one way to trigger this bug. 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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index 84512ec19173..69ef35266bac 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -277,16 +277,16 @@ _req_st_cond(struct drbd_conf *mdev, union drbd_state mask,
os = drbd_read_state(mdev);
ns = sanitize_state(mdev, apply_mask_val(os, mask, val), NULL);
rv = is_valid_transition(os, ns);
- if (rv == SS_SUCCESS)
+ if (rv >= SS_SUCCESS)
rv = SS_UNKNOWN_ERROR; /* cont waiting, otherwise fail. */
if (!cl_wide_st_chg(mdev, os, ns))
rv = SS_CW_NO_NEED;
if (rv == SS_UNKNOWN_ERROR) {
rv = is_valid_state(mdev, ns);
- if (rv == SS_SUCCESS) {
+ if (rv >= SS_SUCCESS) {
rv = is_valid_soft_transition(os, ns, mdev->tconn);
- if (rv == SS_SUCCESS)
+ if (rv >= SS_SUCCESS)
rv = SS_UNKNOWN_ERROR; /* cont waiting, otherwise fail. */
}
}