mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
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>
This commit is contained in:
parent
e0e1665381
commit
367d675da8
1 changed files with 11 additions and 5 deletions
|
@ -2731,14 +2731,18 @@ int get_one_status(struct sk_buff *skb, struct netlink_callback *cb)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (!mdev) {
|
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->minor = -1U;
|
||||||
dh->ret_code = NO_ERROR;
|
dh->ret_code = NO_ERROR;
|
||||||
if (nla_put_drbd_cfg_context(skb, tconn, VOLUME_UNSPECIFIED))
|
if (nla_put_drbd_cfg_context(skb, tconn, VOLUME_UNSPECIFIED))
|
||||||
genlmsg_cancel(skb, dh);
|
goto cancel;
|
||||||
else
|
nc = rcu_dereference(tconn->net_conf);
|
||||||
genlmsg_end(skb, dh);
|
if (nc && net_conf_to_skb(skb, nc, 1) != 0)
|
||||||
goto out;
|
goto cancel;
|
||||||
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
D_ASSERT(mdev->vnr == volume);
|
D_ASSERT(mdev->vnr == volume);
|
||||||
|
@ -2748,9 +2752,11 @@ int get_one_status(struct sk_buff *skb, struct netlink_callback *cb)
|
||||||
dh->ret_code = NO_ERROR;
|
dh->ret_code = NO_ERROR;
|
||||||
|
|
||||||
if (nla_put_status_info(skb, mdev, NULL)) {
|
if (nla_put_status_info(skb, mdev, NULL)) {
|
||||||
|
cancel:
|
||||||
genlmsg_cancel(skb, dh);
|
genlmsg_cancel(skb, dh);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
done:
|
||||||
genlmsg_end(skb, dh);
|
genlmsg_end(skb, dh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue