aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_req.h
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2011-02-21 20:15:32 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-10-14 10:47:51 -0400
commit7be8da0798f08fb9564d4f64fe4a7d6fb4fab20b (patch)
treecdcc85b5152562bd40065cecec7f571098851881 /drivers/block/drbd/drbd_req.h
parent71b1c1eb9c544141e743c4d14b3c576fd4c31a5a (diff)
drbd: Improve how conflicting writes are handled
The previous algorithm for dealing with overlapping concurrent writes was generating unnecessary warnings for scenarios which could be legitimate, and did not always handle partially overlapping requests correctly. Improve it algorithm as follows: * While local or remote write requests are in progress, conflicting new local write requests will be delayed (commit 82172f7). * When a conflict between a local and remote write request is detected, the node with the discard flag decides how to resolve the conflict: It will ask its peer to discard conflicting requests which are fully contained in the local request and retry requests which overlap only partially. This involves a protocol change. 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_req.h')
-rw-r--r--drivers/block/drbd/drbd_req.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_req.h b/drivers/block/drbd/drbd_req.h
index e6f2361d6b19..0b3cd412d52d 100644
--- a/drivers/block/drbd/drbd_req.h
+++ b/drivers/block/drbd/drbd_req.h
@@ -97,7 +97,8 @@ enum drbd_req_event {
97 RECV_ACKED_BY_PEER, 97 RECV_ACKED_BY_PEER,
98 WRITE_ACKED_BY_PEER, 98 WRITE_ACKED_BY_PEER,
99 WRITE_ACKED_BY_PEER_AND_SIS, /* and set_in_sync */ 99 WRITE_ACKED_BY_PEER_AND_SIS, /* and set_in_sync */
100 CONFLICT_DISCARDED_BY_PEER, 100 DISCARD_WRITE,
101 POSTPONE_WRITE,
101 NEG_ACKED, 102 NEG_ACKED,
102 BARRIER_ACKED, /* in protocol A and B */ 103 BARRIER_ACKED, /* in protocol A and B */
103 DATA_RECEIVED, /* (remote read) */ 104 DATA_RECEIVED, /* (remote read) */
@@ -194,6 +195,9 @@ enum drbd_req_state_bits {
194 195
195 /* Should call drbd_al_complete_io() for this request... */ 196 /* Should call drbd_al_complete_io() for this request... */
196 __RQ_IN_ACT_LOG, 197 __RQ_IN_ACT_LOG,
198
199 /* The peer has sent a retry ACK */
200 __RQ_POSTPONED,
197}; 201};
198 202
199#define RQ_LOCAL_PENDING (1UL << __RQ_LOCAL_PENDING) 203#define RQ_LOCAL_PENDING (1UL << __RQ_LOCAL_PENDING)
@@ -214,6 +218,7 @@ enum drbd_req_state_bits {
214 218
215#define RQ_WRITE (1UL << __RQ_WRITE) 219#define RQ_WRITE (1UL << __RQ_WRITE)
216#define RQ_IN_ACT_LOG (1UL << __RQ_IN_ACT_LOG) 220#define RQ_IN_ACT_LOG (1UL << __RQ_IN_ACT_LOG)
221#define RQ_POSTPONED (1UL << __RQ_POSTPONED)
217 222
218/* For waking up the frozen transfer log mod_req() has to return if the request 223/* For waking up the frozen transfer log mod_req() has to return if the request
219 should be counted in the epoch object*/ 224 should be counted in the epoch object*/