drbd:don't increase unacked_cnt when resync write error
PATCH 1/1 drbd:don't increase unacked_cnt when resync write error
In drbd_endio_write_sec_final, if a write error has occured and protocol is not 'C', inc_unacked will be called.
But when it is a resync write, we shouldn't increase the unacked_cnt there because of there is no corresponding dec_unacked, then unacked_cnt will never be zero, which leads to the problem that in do_start_resync, start_resync_timer will be added over and over again and will never end.
Fix this problem by adding a determine, when resync write error, don't increase unacked_cnt in drbd_endio_write_sec_final.
--- drbd/drbd_sender.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drbd/drbd_sender.c +1 -1
@@ -148,7 +148,7 @@ void drbd_endio_write_sec_final(struct drbd_peer_request *peer_req) __releases(l sector = peer_req->i.sector; block_id = peer_req->block_id; -if (peer_req->flags &EE_WAS_ERROR ) { +if ((peer_req->flags &EE_WAS_ERROR ) && (block_id !=ID_SYNCER )) {/* In protocol != C, we usually do not send write acks. * In case of a write error, send the neg ack anyways. */ if (!__test_and_set_bit (__EE_SEND_WRITE_ACK, &peer_req->flags))
Signature · 1 line
1.8.3.1
Looks good to me for drbd-9.0. We would have to take care with the merge up to the actively maintained branches in order to avoid losing the drbd_handle_io_error() call. I suggest we just add the condition to the !__test_and_set_bit(__EE_SEND_WRITE_ACK,...) check. The extra drbd_set_out_of_sync() call is harmless and it keeps the branches similar.
Best regards,
Joel
Applied as
https://github.com/LINBIT/drbd/commit/ecd0bd0c884ae7171b62c38b8f2c56a333898bc5
Thanks!
Joel
Quoted 10 lines · Joel Colledge
Looks good to me for drbd-9.0. We would have to take care with the merge up to the actively maintained branches in order to avoid losing the
drbd_handle_io_error()call. I suggest we just add the condition to the !__test_and_set_bit(__EE_SEND_WRITE_ACK,...) check. The extradrbd_set_out_of_sync()call is harmless and it keeps the branches similar.Best regards,
Joel