summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-01-20 11:46:41 +0100
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-03-10 11:47:58 +0100
commitcd88d030d41a9b0100fd5fee872024e6ebc8b276 (patch)
treec107e24c88fee112ebc85c966573ad51074aed7b
parent79a30d2d71f7be862de93228fe9b919ef664af52 (diff)
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: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r--drivers/block/drbd/drbd_nl.c12
-rw-r--r--include/linux/drbd.h2
2 files changed, 12 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 434b621f76a9..ffe3a97fef9b 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -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)
- retcode = ERR_PAUSE_IS_CLEAR;
+ 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;
diff --git a/include/linux/drbd.h b/include/linux/drbd.h
index d10431fab004..ba5c785d3f7d 100644
--- a/include/linux/drbd.h
+++ b/include/linux/drbd.h
@@ -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