[RFC,8/9] ceph: fix decode_locker to use ceph_decode_entity_addr
diff mbox series

Message ID 20190605131102.13529-9-jlayton@kernel.org
State New
Headers show
Series
  • ceph: add support for addr2 decoding
Related show

Commit Message

Jeff Layton June 5, 2019, 1:11 p.m. UTC
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 net/ceph/cls_lock_client.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/net/ceph/cls_lock_client.c b/net/ceph/cls_lock_client.c
index 4cc28541281b..b1d12bf4b83e 100644
--- a/net/ceph/cls_lock_client.c
+++ b/net/ceph/cls_lock_client.c
@@ -264,8 +264,11 @@  static int decode_locker(void **p, void *end, struct ceph_locker *locker)
 		return ret;
 
 	*p += sizeof(struct ceph_timespec); /* skip expiration */
-	ceph_decode_copy(p, &locker->info.addr, sizeof(locker->info.addr));
-	ceph_decode_addr(&locker->info.addr);
+
+	ret = ceph_decode_entity_addr(p, end, &locker->info.addr);
+	if (ret)
+		return ret;
+
 	len = ceph_decode_32(p);
 	*p += len; /* skip description */