From: Philipp Reisner <philipp.reisner@linbit.com>
To: linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Cc: drbd-dev@lists.linbit.com
Subject: [PATCH 01/11] drbd: Correctly handle resources without volumes
Date: Fri, 14 Oct 2011 23:57:42 +0200 [thread overview]
Message-ID: <1318629472-11110-2-git-send-email-philipp.reisner@linbit.com> (raw)
In-Reply-To: <1318629472-11110-1-git-send-email-philipp.reisner@linbit.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
---
drivers/block/drbd/drbd_nl.c | 3 ++-
drivers/block/drbd/drbd_state.c | 17 +++++++++++++++--
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 20fa803..a71a5f5 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1119,7 +1119,8 @@ static void conn_reconfig_done(struct drbd_tconn *tconn)
{
bool stop_threads;
spin_lock_irq(&tconn->req_lock);
- stop_threads = conn_all_vols_unconf(tconn);
+ stop_threads = conn_all_vols_unconf(tconn) &&
+ tconn->cstate == C_STANDALONE;
spin_unlock_irq(&tconn->req_lock);
if (stop_threads) {
/* asender is implicitly stopped by receiver
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index c4dd667..eafc195 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -1491,9 +1491,15 @@ static int w_after_conn_state_ch(struct drbd_work *w, int unused)
void conn_old_common_state(struct drbd_tconn *tconn, union drbd_state *pcs, enum chg_state_flags *pf)
{
enum chg_state_flags flags = ~0;
- union drbd_dev_state os, cs = {}; /* old_state, common_state */
struct drbd_conf *mdev;
int vnr, first_vol = 1;
+ union drbd_dev_state os, cs = {
+ { .role = R_SECONDARY,
+ .peer = R_UNKNOWN,
+ .conn = tconn->cstate,
+ .disk = D_DISKLESS,
+ .pdsk = D_UNKNOWN,
+ } };
rcu_read_lock();
idr_for_each_entry(&tconn->volumes, mdev, vnr) {
@@ -1574,10 +1580,17 @@ void
conn_set_state(struct drbd_tconn *tconn, union drbd_state mask, union drbd_state val,
union drbd_state *pns_min, union drbd_state *pns_max, enum chg_state_flags flags)
{
- union drbd_state ns, os, ns_max = { };
+ union drbd_state ns, os, ns_max = {
+ { .role = R_SECONDARY,
+ .peer = R_UNKNOWN,
+ .conn = val.conn,
+ .disk = D_DISKLESS,
+ .pdsk = D_UNKNOWN
+ } };
union drbd_state ns_min = {
{ .role = R_MASK,
.peer = R_MASK,
+ .conn = val.conn,
.disk = D_MASK,
.pdsk = D_MASK
} };
--
1.7.4.1
next prev parent reply other threads:[~2011-10-14 21:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-14 21:57 [RFC 00/11] drbd: part 20 of adding multiple volume support to drbd Philipp Reisner
2011-10-14 21:57 ` Philipp Reisner [this message]
2011-10-14 21:57 ` [PATCH 02/11] drbd: report net config even for resources without a single volume Philipp Reisner
2011-10-14 21:57 ` [PATCH 03/11] drbd: Changed some defaults Philipp Reisner
2011-10-14 21:57 ` [PATCH 04/11] drbd: Define scale factors in a single place Philipp Reisner
2011-10-14 21:57 ` [PATCH 05/11] drbd: Fix the maximum accepted minor device number Philipp Reisner
2011-10-14 21:57 ` [PATCH 06/11] drbd: Allow to create devices with a minor number > minor_count Philipp Reisner
2011-10-14 21:57 ` [PATCH 07/11] drbd: Print memory address in hex instead of decimal in error message Philipp Reisner
2011-10-14 21:57 ` [PATCH 08/11] drbd: receive_protocol(): Give variables more easily searchable names Philipp Reisner
2011-10-14 21:57 ` [PATCH 09/11] drbd: receive_protocol(): Make the program flow less confusing Philipp Reisner
2011-10-14 21:57 ` [PATCH 10/11] drbd: Be consistent in reporting incompatibilities in P_PROTOCOL settings Philipp Reisner
2011-10-14 21:57 ` [PATCH 11/11] drbd: receive_protocol(): We cannot change our own data-integrity-alg setting here Philipp Reisner
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=1318629472-11110-2-git-send-email-philipp.reisner@linbit.com \
--to=philipp.reisner@linbit.com \
--cc=axboe@kernel.dk \
--cc=drbd-dev@lists.linbit.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®