Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1719582 > unrolled thread

[PATCH 06/17] drbd: Fix resource role for newly created resources in events2

Started byPhilipp Reisner <philipp.reisner@linbit.com>
First post2017-08-24 23:30 +0200
Last post2017-08-24 23:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 06/17] drbd: Fix resource role for newly created resources in events2 Philipp Reisner <philipp.reisner@linbit.com> - 2017-08-24 23:30 +0200

#1719582 — [PATCH 06/17] drbd: Fix resource role for newly created resources in events2

FromPhilipp Reisner <philipp.reisner@linbit.com>
Date2017-08-24 23:30 +0200
Subject[PATCH 06/17] drbd: Fix resource role for newly created resources in events2
Message-ID<ui7Ro-3tg-15@gated-at.bofh.it>
The conn_higest_role() (a terribly misnamed function) returns
the role of the resource. It returned R_UNKNOWN as long as the
resource has not a single device.

Resources without devices are short living objects.

But it matters for the NOTIFY_CREATE netwlink message. It makes
a lot more sense to report R_SECONDARY for the newly created
resource than R_UNKNOWN.

I reviewd all call sites of conn_highest_role(), that change
does not matter for the other call sites.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>

diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index eea0c4a..306f116 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -346,7 +346,7 @@ static enum drbd_role min_role(enum drbd_role role1, enum drbd_role role2)
 
 enum drbd_role conn_highest_role(struct drbd_connection *connection)
 {
-	enum drbd_role role = R_UNKNOWN;
+	enum drbd_role role = R_SECONDARY;
 	struct drbd_peer_device *peer_device;
 	int vnr;
 
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web