From: Nick Wang <nwang@suse.com>
To: drbd-dev@lists.linbit.com
Cc: Lars Ellenberg <lars.ellenberg@linbit.com>
Subject: [Drbd-dev] [PATCH] drbdadm: Fix handler called from kernel always invalid for stacking resource
Date: Tue, 18 Jul 2017 11:16:15 +0800 [thread overview]
Message-ID: <20170718031615.18985-1-nwang@suse.com> (raw)
Handler like "before-resync-target" called from kernel
space does not have "-S" option for stacking resource, it
always return as invalid usage for stacking resource in
normal mode, then the connection will be dropped. Add "-S"
option for stacking resource automatically if the handler
is called from kernel.
Signed-off-by: Nick Wang <nwang@suse.com>
CC: Lars Ellenberg <lars.ellenberg@linbit.com>
CC: drbd-dev@lists.linbit.com
---
user/v9/drbdadm_main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/user/v9/drbdadm_main.c b/user/v9/drbdadm_main.c
index 3c6e2263..f6cd8b74 100644
--- a/user/v9/drbdadm_main.c
+++ b/user/v9/drbdadm_main.c
@@ -3472,6 +3472,9 @@ int main(int argc, char **argv)
rv = E_USAGE;
continue;
}
+ if (3 == cmd->show_in_usage && ctx.res->stacked) {
+ is_drbd_top = 1;
+ }
if (is_drbd_top != ctx.res->stacked && !is_dump) {
err("'%s' is a %s resource, and not available in %s mode.\n",
ctx.res->name,
--
2.12.0
next reply other threads:[~2017-07-18 3:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-18 3:16 Nick Wang [this message]
2017-07-18 8:22 ` [Drbd-dev] [PATCH] drbdadm: Fix handler called from kernel always invalid for stacking resource Lars Ellenberg
2017-07-18 9:35 ` Nick Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170718031615.18985-1-nwang@suse.com \
--to=nwang@suse.com \
--cc=drbd-dev@lists.linbit.com \
--cc=lars.ellenberg@linbit.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox