Blob Blame History Raw
From: Ilya Dryomov <idryomov@gmail.com>
Date: Wed, 27 Jun 2018 16:42:51 +0200
Subject: libceph: change ceph_pagelist_encode_string() to take u32
Git-commit: c9ed51c9123ab5e8f79b7d53a9afd786b43d4fe6
Patch-mainline: v4.19-rc1
References: FATE#324714

The wire format dictates that the length of string fits into 4 bytes.
Take u32 instead of size_t to reflect that.

We were already truncating len in ceph_pagelist_encode_32() -- this
just pushes that truncation one level up.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Acked-by: Luis Henriques <lhenriques@suse.com>
---
 include/linux/ceph/pagelist.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/include/linux/ceph/pagelist.h
+++ b/include/linux/ceph/pagelist.h
@@ -67,7 +67,7 @@ static inline int ceph_pagelist_encode_8
 	return ceph_pagelist_append(pl, &v, 1);
 }
 static inline int ceph_pagelist_encode_string(struct ceph_pagelist *pl,
-					      char *s, size_t len)
+					      char *s, u32 len)
 {
 	int ret = ceph_pagelist_encode_32(pl, len);
 	if (ret)