Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346123
b: refs/heads/master
c: f132f55
h: refs/heads/master
i:
  346121: cb88c72
  346119: 5fd5d6d
v: v3
  • Loading branch information
Philipp Reisner committed Nov 8, 2012
1 parent 7ddc8b5 commit b540c14
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 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: 97ddb68790891ed568ab8212189f5173dd600ea4
refs/heads/master: f132f554cea3ad1333ff8ea1ac23e1085abd639e
21 changes: 13 additions & 8 deletions trunk/drivers/block/drbd/drbd_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1576,13 +1576,7 @@ void
conn_set_state(struct drbd_tconn *tconn, union drbd_state mask, union drbd_state val,
union drbd_state *pns_min, union drbd_state *pns_max, enum chg_state_flags flags)
{
union drbd_state ns, os, ns_max = {
{ .role = R_SECONDARY,
.peer = R_UNKNOWN,
.conn = val.conn,
.disk = D_DISKLESS,
.pdsk = D_UNKNOWN
} };
union drbd_state ns, os, ns_max = { };
union drbd_state ns_min = {
{ .role = R_MASK,
.peer = R_MASK,
Expand All @@ -1592,13 +1586,14 @@ conn_set_state(struct drbd_tconn *tconn, union drbd_state mask, union drbd_state
} };
struct drbd_conf *mdev;
enum drbd_state_rv rv;
int vnr;
int vnr, number_of_volumes = 0;

if (mask.conn == C_MASK)
tconn->cstate = val.conn;

rcu_read_lock();
idr_for_each_entry(&tconn->volumes, mdev, vnr) {
number_of_volumes++;
os = drbd_read_state(mdev);
ns = apply_mask_val(os, mask, val);
ns = sanitize_state(mdev, ns, NULL);
Expand All @@ -1625,6 +1620,16 @@ conn_set_state(struct drbd_tconn *tconn, union drbd_state mask, union drbd_state
}
rcu_read_unlock();

if (number_of_volumes == 0) {
ns_min = ns_max = (union drbd_state) { {
.role = R_SECONDARY,
.peer = R_UNKNOWN,
.conn = val.conn,
.disk = D_DISKLESS,
.pdsk = D_UNKNOWN
} };
}

ns_min.susp = ns_max.susp = tconn->susp;
ns_min.susp_nod = ns_max.susp_nod = tconn->susp_nod;
ns_min.susp_fen = ns_max.susp_fen = tconn->susp_fen;
Expand Down

0 comments on commit b540c14

Please sign in to comment.