ceph: fix decode_locker to use ceph_decode_entity_addr
authorJeff Layton <jlayton@kernel.org>
Tue, 4 Jun 2019 19:17:32 +0000 (15:17 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 8 Jul 2019 12:01:43 +0000 (14:01 +0200)
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
net/ceph/cls_lock_client.c

index 4cc2854..b1d12bf 100644 (file)
@@ -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 */