aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-06-18 07:56:57 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2010-10-14 08:53:42 -0400
commit47ff2d0a8e7ce87fed180729e8341f650bf585c8 (patch)
treea8b9fb2f76ebf70090328dba7c57144d8352d9e5 /drivers
parent265be2d09853d425ad14a61cda0ca63345613d0c (diff)
drbd: Do not allow a fencing-policy of resource-and-stonith with protocol A
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/drbd/drbd_nl.c20
-rw-r--r--drivers/block/drbd/drbd_req.c2
2 files changed, 20 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 563a6ade0179..5288bd72cd27 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -806,6 +806,15 @@ static int drbd_nl_disk_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp
806 goto fail; 806 goto fail;
807 } 807 }
808 808
809 if (get_net_conf(mdev)) {
810 int prot = mdev->net_conf->wire_protocol;
811 put_net_conf(mdev);
812 if (nbc->dc.fencing == FP_STONITH && prot == DRBD_PROT_A) {
813 retcode = ERR_STONITH_AND_PROT_A;
814 goto fail;
815 }
816 }
817
809 nbc->lo_file = filp_open(nbc->dc.backing_dev, O_RDWR, 0); 818 nbc->lo_file = filp_open(nbc->dc.backing_dev, O_RDWR, 0);
810 if (IS_ERR(nbc->lo_file)) { 819 if (IS_ERR(nbc->lo_file)) {
811 dev_err(DEV, "open(\"%s\") failed with %ld\n", nbc->dc.backing_dev, 820 dev_err(DEV, "open(\"%s\") failed with %ld\n", nbc->dc.backing_dev,
@@ -1238,7 +1247,16 @@ static int drbd_nl_net_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp,
1238 && (new_conf->wire_protocol != DRBD_PROT_C)) { 1247 && (new_conf->wire_protocol != DRBD_PROT_C)) {
1239 retcode = ERR_NOT_PROTO_C; 1248 retcode = ERR_NOT_PROTO_C;
1240 goto fail; 1249 goto fail;
1241 }; 1250 }
1251
1252 if (get_ldev(mdev)) {
1253 enum drbd_fencing_p fp = mdev->ldev->dc.fencing;
1254 put_ldev(mdev);
1255 if (new_conf->wire_protocol == DRBD_PROT_A && fp == FP_STONITH) {
1256 retcode = ERR_STONITH_AND_PROT_A;
1257 goto fail;
1258 }
1259 }
1242 1260
1243 if (mdev->state.role == R_PRIMARY && new_conf->want_lose) { 1261 if (mdev->state.role == R_PRIMARY && new_conf->want_lose) {
1244 retcode = ERR_DISCARD; 1262 retcode = ERR_DISCARD;
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 8259d4f77285..fbe027886bad 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -660,7 +660,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
660 660
661 case resend: 661 case resend:
662 /* If RQ_NET_OK is already set, we got a P_WRITE_ACK or P_RECV_ACK 662 /* If RQ_NET_OK is already set, we got a P_WRITE_ACK or P_RECV_ACK
663 before the connection loss; only P_BARRIER_ACK was missing. 663 before the connection loss (B&C only); only P_BARRIER_ACK was missing.
664 Trowing them out of the TL here by pretending we got a BARRIER_ACK 664 Trowing them out of the TL here by pretending we got a BARRIER_ACK
665 TODO: Either resync them, or ensure peer was not rebooted. */ 665 TODO: Either resync them, or ensure peer was not rebooted. */
666 if (!(req->rq_state & RQ_NET_OK)) { 666 if (!(req->rq_state & RQ_NET_OK)) {