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 02/16] drbd: New minors have to intherit the connection state form their connection
Date: Fri, 2 Sep 2011 12:00:34 +0200 [thread overview]
Message-ID: <1314957648-13242-3-git-send-email-philipp.reisner@linbit.com> (raw)
In-Reply-To: <1314957648-13242-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_int.h | 1 +
drivers/block/drbd/drbd_main.c | 5 +++++
drivers/block/drbd/drbd_receiver.c | 5 +++--
drivers/block/drbd/drbd_state.c | 4 ++--
4 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index d84a073..05bb9fd 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -1595,6 +1595,7 @@ extern void _drbd_wait_ee_list_empty(struct drbd_conf *mdev,
extern void drbd_set_recv_tcq(struct drbd_conf *mdev, int tcq_enabled);
extern void _drbd_clear_done_ee(struct drbd_conf *mdev, struct list_head *to_be_freed);
extern void conn_flush_workqueue(struct drbd_tconn *tconn);
+extern int drbd_connected(int vnr, void *p, void *data);
static inline void drbd_flush_workqueue(struct drbd_conf *mdev)
{
conn_flush_workqueue(mdev->tconn);
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index de49c8d..4bfffe9 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2410,6 +2410,11 @@ enum drbd_ret_code conn_new_minor(struct drbd_tconn *tconn, unsigned int minor,
}
add_disk(disk);
+ /* inherit the connection state */
+ mdev->state.conn = tconn->cstate;
+ if (mdev->state.conn == C_WF_REPORT_PARAMS)
+ drbd_connected(vnr, mdev, tconn);
+
return NO_ERROR;
out_idr_remove_vol:
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 956a0e2..1c83a12 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -744,8 +744,9 @@ static int drbd_socket_okay(struct socket **sock)
return false;
}
}
-
-static int drbd_connected(int vnr, void *p, void *data)
+/* Gets called if a connection is established, or if a new minor gets created
+ in a connection */
+int drbd_connected(int vnr, void *p, void *data)
{
struct drbd_conf *mdev = (struct drbd_conf *)p;
int ok = 1;
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index 3ca535e..37b52d7 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -433,8 +433,8 @@ is_valid_soft_transition(union drbd_state os, union drbd_state ns)
if (ns.conn == C_DISCONNECTING && os.conn == C_UNCONNECTED)
rv = SS_IN_TRANSIENT_STATE;
- if (ns.conn == os.conn && ns.conn == C_WF_REPORT_PARAMS)
- rv = SS_IN_TRANSIENT_STATE;
+ /* if (ns.conn == os.conn && ns.conn == C_WF_REPORT_PARAMS)
+ rv = SS_IN_TRANSIENT_STATE; */
if ((ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T) && os.conn < C_CONNECTED)
rv = SS_NEED_CONNECTION;
--
1.7.4.1
next prev parent reply other threads:[~2011-09-02 10:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-02 10:00 [RFC 00/16] drbd: part 5 of adding multiple volume support to drbd Philipp Reisner
2011-09-02 10:00 ` [PATCH 01/16] drbd: process_done_ee() has to handle unconfigured devices now Philipp Reisner
2011-09-02 10:00 ` Philipp Reisner [this message]
2011-09-02 10:00 ` [PATCH 03/16] drbd: Allow two diskless minors to be connected Philipp Reisner
2011-09-02 10:00 ` [PATCH 04/16] drbd: Do not modify the connection state with something else that conn_request_state() Philipp Reisner
2011-09-02 10:00 ` [PATCH 05/16] drbd: Moved CONN_DRY_RUN to the per connection (tconn) flags Philipp Reisner
2011-09-02 10:00 ` [PATCH 06/16] drbd: Allow packet handler functions that take a connection Philipp Reisner
2011-09-02 10:00 ` [PATCH 07/16] drbd: Converted receive_protocol() from mdev to tconn Philipp Reisner
2011-09-02 10:00 ` [PATCH 08/16] drbd: Separate connection state changes from minor dev state changes #1 Philipp Reisner
2011-09-02 10:00 ` [PATCH 09/16] drbd: Allow packet handler functions that take a connection (meta connection) Philipp Reisner
2011-09-02 10:00 ` [PATCH 10/16] drbd: Converted got_Ping() and got_PingAck() from mdev to tconn Philipp Reisner
2011-09-02 10:00 ` [PATCH 11/16] drbd: Separate connection state changes from minor dev state changes #2 Philipp Reisner
2011-09-02 10:00 ` [PATCH 12/16] drbd: fix conn_reconfig_start without conn_reconfig_done in drbd_adm_attach Philipp Reisner
2011-09-02 10:00 ` [PATCH 13/16] drbd: Allow volumes to become primary only on one side Philipp Reisner
2011-09-02 10:00 ` [PATCH 14/16] drbd: conn_khelper() for user mode callbacks for connections Philipp Reisner
2011-09-02 10:00 ` [PATCH 15/16] drbd: distribute former syncer_conf settings to disk, connection, and resource level Philipp Reisner
2011-09-02 10:00 ` [PATCH 16/16] drbd: Fixed conn_lowest_minor 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=1314957648-13242-3-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®