summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2020-11-25 16:41:59 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-30 17:23:11 +0300
commit145248ebe0b2164f7d383cc942ec45fbd3c4b1a0 (patch)
tree4ecdfa469b2d6e6d01e199256fdc4a0cebe74ef9 /include
parent61c303cfb1353754831aaa82ead4e698d2f6f5ae (diff)
downloadlinux-145248ebe0b2164f7d383cc942ec45fbd3c4b1a0.tar.xz
libceph, rbd: ignore addr->type while comparing in some cases
[ Upstream commit 313771e80fd253d4b5472e61a2d12b03c5293aa9 ] 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> Stable-dep-of: 588159009d5b ("rbd: retrieve and check lock owner twice before blocklisting") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ceph/msgr.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/ceph/msgr.h b/include/linux/ceph/msgr.h
index 9e50aede46c8..7bde0af29a81 100644
--- a/include/linux/ceph/msgr.h
+++ b/include/linux/ceph/msgr.h
@@ -61,11 +61,18 @@ extern const char *ceph_entity_type_name(int type);
* entity_addr -- network address
*/
struct ceph_entity_addr {
- __le32 type;
+ __le32 type; /* CEPH_ENTITY_ADDR_TYPE_* */
__le32 nonce; /* unique id for process (e.g. pid) */
struct sockaddr_storage in_addr;
} __attribute__ ((packed));
+static inline bool ceph_addr_equal_no_type(const struct ceph_entity_addr *lhs,
+ const struct ceph_entity_addr *rhs)
+{
+ return !memcmp(&lhs->in_addr, &rhs->in_addr, sizeof(lhs->in_addr)) &&
+ lhs->nonce == rhs->nonce;
+}
+
struct ceph_entity_inst {
struct ceph_entity_name name;
struct ceph_entity_addr addr;