Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346059
b: refs/heads/master
c: 6139f60
h: refs/heads/master
i:
  346057: 28e4077
  346055: 9da0eed
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Nov 8, 2012
1 parent 7a2226a commit 57a0fbd
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 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: 7bac3e6f7e74993475a94487effe05dc1f68bdc7
refs/heads/master: 6139f60dc192e2c5478c1126d1aff7905dc0a98a
2 changes: 1 addition & 1 deletion trunk/drivers/block/drbd/drbd_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ struct p_rs_param_95 {
} __packed;

enum drbd_conn_flags {
CF_WANT_LOSE = 1,
CF_DISCARD_MY_DATA = 1,
CF_DRY_RUN = 2,
};

Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,8 +943,8 @@ int __drbd_send_protocol(struct drbd_tconn *tconn)
p->after_sb_2p = cpu_to_be32(nc->after_sb_2p);
p->two_primaries = cpu_to_be32(nc->two_primaries);
cf = 0;
if (nc->want_lose)
cf |= CF_WANT_LOSE;
if (nc->discard_my_data)
cf |= CF_DISCARD_MY_DATA;
if (nc->dry_run)
cf |= CF_DRY_RUN;
p->conn_flags = cpu_to_be32(cf);
Expand Down Expand Up @@ -988,7 +988,7 @@ int _drbd_send_uuids(struct drbd_conf *mdev, u64 uuid_flags)
mdev->comm_bm_set = drbd_bm_total_weight(mdev);
p->uuid[UI_SIZE] = cpu_to_be64(mdev->comm_bm_set);
rcu_read_lock();
uuid_flags |= rcu_dereference(mdev->tconn->net_conf)->want_lose ? 1 : 0;
uuid_flags |= rcu_dereference(mdev->tconn->net_conf)->discard_my_data ? 1 : 0;
rcu_read_unlock();
uuid_flags |= test_bit(CRASHED_PRIMARY, &mdev->flags) ? 2 : 0;
uuid_flags |= mdev->new_state_tmp.disk == D_INCONSISTENT ? 4 : 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/block/drbd/drbd_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force)
mutex_lock(&mdev->tconn->conf_update);
nc = mdev->tconn->net_conf;
if (nc)
nc->want_lose = 0; /* without copy; single bit op is atomic */
nc->discard_my_data = 0; /* without copy; single bit op is atomic */
mutex_unlock(&mdev->tconn->conf_update);

set_disk_ro(mdev->vdisk, false);
Expand Down Expand Up @@ -1738,7 +1738,7 @@ _check_net_options(struct drbd_tconn *tconn, struct net_conf *old_conf, struct n
if (new_conf->wire_protocol == DRBD_PROT_A && fp == FP_STONITH)
return ERR_STONITH_AND_PROT_A;
}
if (mdev->state.role == R_PRIMARY && new_conf->want_lose)
if (mdev->state.role == R_PRIMARY && new_conf->discard_my_data)
return ERR_DISCARD;
}

Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2908,9 +2908,9 @@ static enum drbd_conns drbd_sync_handshake(struct drbd_conf *mdev, enum drbd_rol
}

if (hg == -100) {
if (nc->want_lose && !(mdev->p_uuid[UI_FLAGS]&1))
if (nc->discard_my_data && !(mdev->p_uuid[UI_FLAGS]&1))
hg = -1;
if (!nc->want_lose && (mdev->p_uuid[UI_FLAGS]&1))
if (!nc->discard_my_data && (mdev->p_uuid[UI_FLAGS]&1))
hg = 1;

if (abs(hg) < 100)
Expand Down Expand Up @@ -3009,7 +3009,7 @@ static int receive_protocol(struct drbd_tconn *tconn, struct packet_info *pi)
{
struct p_protocol *p = pi->data;
int p_proto, p_after_sb_0p, p_after_sb_1p, p_after_sb_2p;
int p_want_lose, p_two_primaries, cf;
int p_discard_my_data, p_two_primaries, cf;
struct net_conf *nc;

p_proto = be32_to_cpu(p->protocol);
Expand All @@ -3018,7 +3018,7 @@ static int receive_protocol(struct drbd_tconn *tconn, struct packet_info *pi)
p_after_sb_2p = be32_to_cpu(p->after_sb_2p);
p_two_primaries = be32_to_cpu(p->two_primaries);
cf = be32_to_cpu(p->conn_flags);
p_want_lose = cf & CF_WANT_LOSE;
p_discard_my_data = cf & CF_DISCARD_MY_DATA;

if (tconn->agreed_pro_version >= 87) {
char integrity_alg[SHARED_SECRET_MAX];
Expand Down Expand Up @@ -3075,8 +3075,8 @@ static int receive_protocol(struct drbd_tconn *tconn, struct packet_info *pi)
goto disconnect_rcu_unlock;
}

if (p_want_lose && nc->want_lose) {
conn_err(tconn, "both sides have the 'want_lose' flag set\n");
if (p_discard_my_data && nc->discard_my_data) {
conn_err(tconn, "both sides have the 'discard_my_data' flag set\n");
goto disconnect_rcu_unlock;
}

Expand Down Expand Up @@ -3806,7 +3806,7 @@ static int receive_state(struct drbd_tconn *tconn, struct packet_info *pi)
}

mutex_lock(&mdev->tconn->conf_update);
mdev->tconn->net_conf->want_lose = 0; /* without copy; single bit op is atomic */
mdev->tconn->net_conf->discard_my_data = 0; /* without copy; single bit op is atomic */
mutex_unlock(&mdev->tconn->conf_update);

drbd_md_sync(mdev); /* update connected indicator, la_size, ... */
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/drbd_genl.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ GENL_struct(DRBD_NLA_NET_CONF, 5, net_conf,
__u32_field_def(24, GENLA_F_MANDATORY, cong_fill, DRBD_CONG_FILL_DEF)
__u32_field_def(25, GENLA_F_MANDATORY, cong_extents, DRBD_CONG_EXTENTS_DEF)
__flg_field_def(26, GENLA_F_MANDATORY, two_primaries, DRBD_ALLOW_TWO_PRIMARIES_DEF)
__flg_field(27, GENLA_F_MANDATORY | GENLA_F_INVARIANT, want_lose)
__flg_field(27, GENLA_F_MANDATORY | GENLA_F_INVARIANT, discard_my_data)
__flg_field_def(28, GENLA_F_MANDATORY, tcp_cork, DRBD_TCP_CORK_DEF)
__flg_field_def(29, GENLA_F_MANDATORY, always_asbp, DRBD_ALWAYS_ASBP_DEF)
__flg_field(30, GENLA_F_MANDATORY | GENLA_F_INVARIANT, dry_run)
Expand Down

0 comments on commit 57a0fbd

Please sign in to comment.