From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bucxo-0002m5-Mw for qemu-devel@nongnu.org; Thu, 13 Oct 2016 06:10:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bucxm-0005rM-RZ for qemu-devel@nongnu.org; Thu, 13 Oct 2016 06:10:11 -0400 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]:35921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bucxm-0005r6-Mn for qemu-devel@nongnu.org; Thu, 13 Oct 2016 06:10:10 -0400 Received: by mail-oi0-x243.google.com with SMTP id e12so5206606oib.3 for ; Thu, 13 Oct 2016 03:10:10 -0700 (PDT) Message-ID: <57ff5d81.4a3c9d0a.90936.609e@mx.google.com> From: Li Qiang Date: Thu, 13 Oct 2016 03:09:42 -0700 In-Reply-To: <1476353383-4679-1-git-send-email-Qiang(liqiang6-s@360.cn)> References: <1476353383-4679-1-git-send-email-Qiang(liqiang6-s@360.cn)> Subject: [Qemu-devel] [PATCH v3 2/3] 9pfs: convert 'len/copied_len' field in V9fsXattr to the type of uint64_t List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: groug@kaod.org, qemu-devel@nongnu.org Cc: Li Qiang From: Li Qiang The 'len' in V9fsXattr comes from the 'size' argument in setxattr() function in guest. The setxattr() function's declaration is this: int setxattr(const char *path, const char *name, const void *value, size_t size, int flags); and 'size' is treated as u64 in linux kernel client code: int p9_client_xattrcreate(struct p9_fid *fid, const char *name, u64 attr_size, int flags) So the 'len' should have an type of 'uint64_t'. The 'copied_len' in V9fsXattr is used to account for copied bytes, it should also have an type of 'uint64_t'. Suggested-by: Greg Kurz Signed-off-by: Li Qiang --- hw/9pfs/9p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index aa18da1..7fb075f 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -159,8 +159,8 @@ typedef struct V9fsConf typedef struct V9fsXattr { - int64_t copied_len; - int64_t len; + uint64_t copied_len; + uint64_t len; void *value; V9fsString name; int flags; -- 1.8.3.1