drbd: Send P_NEG_ACK upon write error in protocol != C
authorLars Ellenberg <lars.ellenberg@linbit.com>
Tue, 29 Aug 2017 08:20:35 +0000 (10:20 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 Aug 2017 21:34:44 +0000 (15:34 -0600)
commite1fbc4ca9d0353a932994cb1ac38e87e5a211a9f
treea0033cedc47e075ab237059ea800e2e098f89d14
parentde6978be4407ced653dda5d6c052d67d8d768dd0
drbd: Send P_NEG_ACK upon write error in protocol != C

In protocol != C, we forgot to send the P_NEG_ACK for failing writes.

Once we no longer submit to local disk, because we already "detached",
due to the typical "on-io-error detach;" config setting,
we already send the neg acks right away.

Only those requests that have been submitted,
and have been error-completed by the local disk,
would forget to send the neg-ack,
and only in asynchronous replication (protocol != C).
Unless this happened during resync,
where we already always send acks, regardless of protocol.

The primary side needs the P_NEG_ACK in order to mark
the affected block(s) for resync in its out-of-sync bitmap.

If the blocks in question are not re-written again,
we may miss to resync them later, causing data inconsistencies.

This patch will always send the neg-acks, and also at least try to
persist the out-of-sync status on the local node already.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/drbd/drbd_worker.c