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 09/10] drbd: Fixed removal of volumes/devices from connected resources
Date: Thu, 13 Oct 2011 12:32:15 +0200 [thread overview]
Message-ID: <1318501936-11689-10-git-send-email-philipp.reisner@linbit.com> (raw)
In-Reply-To: <1318501936-11689-1-git-send-email-philipp.reisner@linbit.com>
When removing a volume/device we need to switch the connection
status of the peer back into WFReportParams.
Before this fix it was left in Connected state. That means that
the peer device continued to inform us about state changes, etc...
But we deleted that minor -> protocol error.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
---
drivers/block/drbd/drbd_nl.c | 2 ++
drivers/block/drbd/drbd_receiver.c | 1 +
drivers/block/drbd/drbd_state.c | 6 ++++--
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 463029a..79397b6 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -3107,6 +3107,8 @@ static enum drbd_ret_code adm_delete_minor(struct drbd_conf *mdev)
* we may want to delete a minor from a live replication group.
*/
mdev->state.role == R_SECONDARY) {
+ _drbd_request_state(mdev, NS(conn, C_WF_REPORT_PARAMS),
+ CS_VERBOSE + CS_WAIT_COMPLETE);
idr_remove(&mdev->tconn->volumes, mdev->vnr);
idr_remove(&minors, mdev_to_minor(mdev));
del_gendisk(mdev->vdisk);
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 3a7e54b..d4e677c 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -3628,6 +3628,7 @@ static union drbd_state convert_state(union drbd_state ps)
union drbd_state ms;
static enum drbd_conns c_tab[] = {
+ [C_WF_REPORT_PARAMS] = C_WF_REPORT_PARAMS,
[C_CONNECTED] = C_CONNECTED,
[C_STARTING_SYNC_S] = C_STARTING_SYNC_T,
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index 65d22f3..fe46a8b 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -201,7 +201,8 @@ static int cl_wide_st_chg(struct drbd_conf *mdev,
(os.conn != C_STARTING_SYNC_S && ns.conn == C_STARTING_SYNC_S) ||
(os.disk != D_DISKLESS && ns.disk == D_DISKLESS))) ||
(os.conn >= C_CONNECTED && ns.conn == C_DISCONNECTING) ||
- (os.conn == C_CONNECTED && ns.conn == C_VERIFY_S);
+ (os.conn == C_CONNECTED && ns.conn == C_VERIFY_S) ||
+ (os.conn == C_CONNECTED && ns.conn == C_WF_REPORT_PARAMS);
}
static union drbd_state
@@ -1202,7 +1203,8 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
}
/* Do not change the order of the if above and the two below... */
- if (os.pdsk == D_DISKLESS && ns.pdsk > D_DISKLESS) { /* attach on the peer */
+ if (os.pdsk == D_DISKLESS &&
+ ns.pdsk > D_DISKLESS && ns.pdsk != D_UNKNOWN) { /* attach on the peer */
drbd_send_uuids(mdev);
drbd_send_state(mdev);
}
--
1.7.4.1
next prev parent reply other threads:[~2011-10-13 10:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-13 10:32 [RFC 00/10] drbd: part 19 of adding multiple volume support to drbd Philipp Reisner
2011-10-13 10:32 ` [PATCH 01/10] drbd: allow ping-timeout of up to 30 seconds Philipp Reisner
2011-10-13 10:32 ` [PATCH 02/10] drbd: downgraded error printk to info Philipp Reisner
2011-10-13 10:32 ` [PATCH 03/10] drbd: Fixes from the 8.3 development branch Philipp Reisner
2011-10-13 10:32 ` [PATCH 04/10] drbd: Improve compatibility with drbd's older than 8.3.7 Philipp Reisner
2011-10-13 10:32 ` [PATCH 05/10] drbd: Fixed state transitions in case reading meta data failes Philipp Reisner
2011-10-13 10:32 ` [PATCH 06/10] drbd: Improve the "unexpected packet" error messages Philipp Reisner
2011-10-13 10:32 ` [PATCH 07/10] drbd: detach from frozen backing device Philipp Reisner
2011-10-13 10:32 ` [PATCH 08/10] drbd: on attach, enforce clean meta data Philipp Reisner
2011-10-13 10:32 ` Philipp Reisner [this message]
2011-10-13 10:32 ` [PATCH 10/10] drbd: Eliminated the "notified peer" messages 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=1318501936-11689-10-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®