From patchwork Thu Oct 13 10:09:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 9374717 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B2F8D60779 for ; Thu, 13 Oct 2016 10:10:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1FFF29907 for ; Thu, 13 Oct 2016 10:10:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 921E6299C7; Thu, 13 Oct 2016 10:10:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B5A3129907 for ; Thu, 13 Oct 2016 10:10:47 +0000 (UTC) Received: from localhost ([::1]:39072 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bucyM-0002qL-Qc for patchwork-qemu-devel@patchwork.kernel.org; Thu, 13 Oct 2016 06:10:46 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:cc:subject:date:in-reply-to:references; bh=0y7GuRyKo2QgAzicjisGbYlYvKiYPCBH56dsT66BqPk=; b=K/HWuY718zG3scK2JvrVPdFGf5n/XX7tjOFtPJ1sF7bdKQ2xoM7r5YEd71HeiqmEjV HsofyIuX79+/YP2NHUondy9mx/cTf/bazuLh3RXqA7dV8Mu7mUcAAtVxk2Xnxi857MfR HP4HsehLWk2w+WU5R2s+7Cvgy56oCI89P2Ee+PjEZtBM/Jl8HnT+Pxdzh3wau3657Lx9 fwo8GVHkWRUE5CSxXUSiO7CBn/Z63cZv+mSx8hmR3JGtbgHy51VxcMFSYiwLXCF6vS2X dpmu6qb9Amjzhp3hyh2lhx2LKh8YmKQ0G2Cmob63R81taG2PHX1feRIDfuiKPplleePH UbEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:from:to:cc:subject:date:in-reply-to :references; bh=0y7GuRyKo2QgAzicjisGbYlYvKiYPCBH56dsT66BqPk=; b=DD6xDUBa2kPq1jIW33AOgoMujm+HozprTGqP1v3A2GlbQ4ETeqzGELjSkJvykonBdc re6eYrm0Ad+I3z54hAIu2KKhp2gwN/t8h0z8jHlLN+NGFc/kaYODi8jG1FyU0a+RJf64 bc8mxMyokyq8xprPO3NQAj1x79L/1GkKdFHeyZUQ115VkYP6KOg0hwVPifDQq4cq7zaK JNew2dxHpmdr2XVacb4G3/8hXijebe5pO5WOdnyWrgjybPx4GwOXDPc6mmAufVnX1dkq 9FmWylEkmXaakDULJ9yDChw4LdnhzVrkt3WY+vwLMLo5Yjl0/KdgCiL//pFDcXjOvlkc AjPA== X-Gm-Message-State: AA6/9Rld43bXnNFJCQ41v3sPgrV/PArcpuZSQE6Wml5F2oRQ7XvfeWFl9+CqNjHca1GJ4w== X-Received: by 10.157.19.86 with SMTP id q22mr3036995otq.118.1476353410432; Thu, 13 Oct 2016 03:10:10 -0700 (PDT) Received: from localhost.localdomain.localdomain ([104.192.110.250]) by smtp.gmail.com with ESMTPSA id j10sm4245734ote.9.2016.10.13.03.10.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Oct 2016 03:10:09 -0700 (PDT) Message-ID: <57ff5d81.4a3c9d0a.90936.609e@mx.google.com> X-Google-Original-Message-ID: <1476353383-4679-3-git-send-email-Qiang(liqiang6-s@360.cn)> From: Li Qiang X-Google-Original-From: Li Qiang(liqiang6-s@360.cn) To: groug@kaod.org, qemu-devel@nongnu.org Date: Thu, 13 Oct 2016 03:09:42 -0700 X-Mailer: git-send-email 1.8.3.1 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)> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::243 Subject: [Qemu-devel] [PATCH v3 2/3] 9pfs: convert 'len/copied_len' field in V9fsXattr to the type of uint64_t X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Qiang Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Greg Kurz --- 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;