Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd88d030 authored by Philipp Reisner's avatar Philipp Reisner
Browse files

drbd: Provide hints with the error message when clearing the sync pause flag



When the user clears the sync-pause flag, and sync stays in pause
state, give hints to the user, why it still is in pause state.

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 79a30d2d
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -1952,9 +1952,17 @@ static int drbd_nl_resume_sync(struct drbd_conf *mdev, struct drbd_nl_cfg_req *n
			       struct drbd_nl_cfg_reply *reply)
{
	int retcode = NO_ERROR;
	union drbd_state s;

	if (drbd_request_state(mdev, NS(user_isp, 0)) == SS_NOTHING_TO_DO)
	if (drbd_request_state(mdev, NS(user_isp, 0)) == SS_NOTHING_TO_DO) {
		s = mdev->state;
		if (s.conn == C_PAUSED_SYNC_S || s.conn == C_PAUSED_SYNC_T) {
			retcode = s.aftr_isp ? ERR_PIC_AFTER_DEP :
				  s.peer_isp ? ERR_PIC_PEER_DEP : ERR_PAUSE_IS_CLEAR;
		} else {
			retcode = ERR_PAUSE_IS_CLEAR;
		}
	}

	reply->ret_code = retcode;
	return 0;
+2 −0
Original line number Diff line number Diff line
@@ -153,6 +153,8 @@ enum drbd_ret_code {
	ERR_NEED_APV_93		= 153,
	ERR_STONITH_AND_PROT_A  = 154,
	ERR_CONG_NOT_PROTO_A	= 155,
	ERR_PIC_AFTER_DEP	= 156,
	ERR_PIC_PEER_DEP	= 157,

	/* insert new ones above this line */
	AFTER_LAST_ERR_CODE