aboutsummaryrefslogtreecommitdiff
path: root/drivers/block/drbd/drbd_nl.c
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2011-07-11 23:49:55 +0200
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 16:57:53 +0100
commit367d675da8fa0041e0f336ecf940992837cc4c50 (patch)
tree7084013a470df12bae9fada5e8b7f752414bddf7 /drivers/block/drbd/drbd_nl.c
parente0e1665381a519fd1f588948b1c48b5e609e336d (diff)
downloadvexpress-lsk-367d675da8fa0041e0f336ecf940992837cc4c50.tar.gz
drbd: report net config even for resources without a single volume
Currently it is legal (though unusual) to create and connect a resource, before adding in all necessary volumes. We should include the network configuration details, even if we don't have a single volume (yet). Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_nl.c')
-rw-r--r--drivers/block/drbd/drbd_nl.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 862d69e9f1a..c27b428b9a5 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -2731,14 +2731,18 @@ next_tconn:
goto out;
if (!mdev) {
- /* this is a tconn without a single volume */
+ /* This is a tconn without a single volume.
+ * Suprisingly enough, it may have a network
+ * configuration. */
+ struct net_conf *nc;
dh->minor = -1U;
dh->ret_code = NO_ERROR;
if (nla_put_drbd_cfg_context(skb, tconn, VOLUME_UNSPECIFIED))
- genlmsg_cancel(skb, dh);
- else
- genlmsg_end(skb, dh);
- goto out;
+ goto cancel;
+ nc = rcu_dereference(tconn->net_conf);
+ if (nc && net_conf_to_skb(skb, nc, 1) != 0)
+ goto cancel;
+ goto done;
}
D_ASSERT(mdev->vnr == volume);
@@ -2748,9 +2752,11 @@ next_tconn:
dh->ret_code = NO_ERROR;
if (nla_put_status_info(skb, mdev, NULL)) {
+cancel:
genlmsg_cancel(skb, dh);
goto out;
}
+done:
genlmsg_end(skb, dh);
}