libceph: Assign different global_id for each ceph_auth_client.
PATCH 1/1 libceph: Assign different global_id for each ceph_auth_client.
From: "Yan, Zheng" <[email protected]>
The global_id for ceph_auth_client is always zero. It prevents the kernel from creating more than one ceph_clients that are connected to the same cluster. (ceph_debugfs_client_init() fails to create debugfs directory)
Without this patch, I can't using rbd and cephfs on the same machine.
--- net/ceph/auth.c | 3 +++ 1 file changed, 3 insertions(+)
net/ceph/auth.c +3 -0
@@ -12,6 +12,8 @@#include "auth_x.h" +static u64 auth_global_id; +/* * get protocol handler */
@@ -54,6 +56,7 @@ struct ceph_auth_client *ceph_auth_init(const char *name, const struct ceph_cryp ac->name =CEPH_AUTH_NAME_DEFAULT ;dout ("auth_init name %s\n" , ac->name); ac->key = key; + ac->global_id = ++auth_global_id;return ac; out:
Signature · 1 line
1.7.11.2
Quoted 10 lines · Zheng
From: "Yan, Zheng" <[email protected]>
The
global_idforceph_auth_clientis always zero. It prevents the kernel from creating more than oneceph_clientsthat are connected to the same cluster. (ceph_debugfs_client_init()fails to create debugfs directory)Without this patch, I can't using rbd and cephfs on the same machine.
Signed-off-by Yan, Zheng <[email protected]>
This one is a bit more complicated. The global_id is a cluster-wide unique id assigned by the monitor. We can't set up the debugfs dir until we have that and the fsid. The check was in handle_monmap, I suspect because long ago the fsid was learned after the global_id, whereas now it is normally fsid and then global_id.
I just sent two patches that restructure this so that we will initialize debugfs only after getting both values, regardless of which order. Let me know if that resolves things on your end; it's working for me :)
Thanks!
sage
Quoted 34 lines
--- net/ceph/auth.c | 3 +++ 1 file changed, 3 insertions(+)net/ceph/auth.c +3
-0@@ -12,6 +12,8 @@#include "auth_x.h" +static u64 auth_global_id; +/* * get protocol handler */ @@ -54,6 +56,7 @@ struct ceph_auth_client *ceph_auth_init(const char *name, const struct ceph_cryp ac->name =CEPH_AUTH_NAME_DEFAULT ;dout ("auth_init name %s\n" , ac->name); ac->key = key; + ac->global_id = ++auth_global_id;return ac; out:Signature · 6 lines
1.7.11.2 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html