diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2020-11-25 14:41:59 +0100 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2020-12-14 23:21:50 +0100 |
commit | 313771e80fd253d4b5472e61a2d12b03c5293aa9 (patch) | |
tree | ea68c9749cc6572ee219bd8dd91b5cec6479b9b2 /net | |
parent | libceph, ceph: get and handle cluster maps with addrvecs (diff) | |
download | linux-313771e80fd253d4b5472e61a2d12b03c5293aa9.tar.xz linux-313771e80fd253d4b5472e61a2d12b03c5293aa9.zip |
libceph, rbd: ignore addr->type while comparing in some cases
For libceph, this ensures that libceph instance sharing (share option)
continues to work. For rbd, this avoids blocklisting alive lock owners
(locker addr is always LEGACY, while watcher addr is ANY in nautilus).
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/ceph/mon_client.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c index a9754a7fa78c..f5f090b4e409 100644 --- a/net/ceph/mon_client.c +++ b/net/ceph/mon_client.c @@ -161,9 +161,11 @@ int ceph_monmap_contains(struct ceph_monmap *m, struct ceph_entity_addr *addr) { int i; - for (i = 0; i < m->num_mon; i++) - if (memcmp(addr, &m->mon_inst[i].addr, sizeof(*addr)) == 0) + for (i = 0; i < m->num_mon; i++) { + if (ceph_addr_equal_no_type(addr, &m->mon_inst[i].addr)) return 1; + } + return 0; } |