Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345957
b: refs/heads/master
c: 778bcf2
h: refs/heads/master
i:
  345955: d17e413
v: v3
  • Loading branch information
Philipp Reisner committed Nov 8, 2012
1 parent a47c3bf commit 3b34a3a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 435693e89b7a918b14ea67968971a2d8d9e88df2
refs/heads/master: 778bcf2e290fc9f13735c32640cdafb34794ebd1
2 changes: 1 addition & 1 deletion trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3447,7 +3447,7 @@ static int receive_req_conn_state(struct drbd_tconn *tconn, struct packet_info *
mask = convert_state(mask);
val = convert_state(val);

rv = conn_request_state(tconn, mask, val, CS_VERBOSE | CS_LOCAL_ONLY);
rv = conn_request_state(tconn, mask, val, CS_VERBOSE | CS_LOCAL_ONLY | CS_IGN_OUTD_FAIL);
conn_send_sr_reply(tconn, rv);

return 0;
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/block/drbd/drbd_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,9 @@ conn_is_valid_transition(struct drbd_tconn *tconn, union drbd_state mask, union
os = mdev->state;
ns = sanitize_state(mdev, apply_mask_val(os, mask, val), NULL);

if (flags & CS_IGN_OUTD_FAIL && ns.disk == D_OUTDATED && os.disk < D_OUTDATED)
ns.disk = os.disk;

if (ns.i == os.i)
continue;

Expand Down Expand Up @@ -1475,6 +1478,9 @@ conn_set_state(struct drbd_tconn *tconn, union drbd_state mask, union drbd_state
ns = apply_mask_val(os, mask, val);
ns = sanitize_state(mdev, ns, NULL);

if (flags & CS_IGN_OUTD_FAIL && ns.disk == D_OUTDATED && os.disk < D_OUTDATED)
ns.disk = os.disk;

rv = __drbd_set_state(mdev, ns, flags, NULL);
if (rv < SS_SUCCESS)
BUG();
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/block/drbd/drbd_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ enum chg_state_flags {
CS_DC_DISK = 1 << 8,
CS_DC_PDSK = 1 << 9,
CS_DC_MASK = CS_DC_ROLE + CS_DC_PEER + CS_DC_CONN + CS_DC_DISK + CS_DC_PDSK,
CS_IGN_OUTD_FAIL = 1 << 10,
};

extern enum drbd_state_rv drbd_change_state(struct drbd_conf *mdev,
Expand Down

0 comments on commit 3b34a3a

Please sign in to comment.