From patchwork Wed Oct 18 12:33:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 10014629 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 51FF5601E7 for ; Wed, 18 Oct 2017 12:43:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FCE528B35 for ; Wed, 18 Oct 2017 12:43:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34A4528B38; Wed, 18 Oct 2017 12:43:08 +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_SIGNED, 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 B547428B35 for ; Wed, 18 Oct 2017 12:43:07 +0000 (UTC) Received: from localhost ([::1]:44462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4ngg-0003KL-VM for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 Oct 2017 08:43:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXe-0005IA-UX for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXZ-0003zT-42 for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:46 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:51460) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXY-0003z5-St for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:41 -0400 Received: by mail-lf0-x243.google.com with SMTP id r129so5622356lff.8 for ; Wed, 18 Oct 2017 05:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/XwIGgOXv4F9+pRS0TzrF1GrdJ9DxxkMfT3QupPCcYY=; b=g6qGhgegiIRM47mnhXrH1wEGfptGOVXhCsZsj3kK63wlT3GrucnPInJOzhgsILq0DI K53Q+DHTVFZ0rSxV/FAZ/dgRmhzCIrHVzyA99fzc18eE+4CwDPgn99NPSy0945ssHGaG nO7Kw3cx0HQqSI2DJZQxho1TeJPwhmqulkMkY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/XwIGgOXv4F9+pRS0TzrF1GrdJ9DxxkMfT3QupPCcYY=; b=PiTT9eZTpd8f0/Hg9xBWVormMks+RzP3jhnQ2P0gS5eHsvl7eONgssKPFj418723pj 9d/ZwjkFTMLgh1z5WTv81gxDZ9t04dHYj0IQy97sEqYBer2VYoZQlfdJlv5QgFlkAmrl eUZ6wtMWWqSlW6HuXFR1x3rFZLNPUdBNweE7j/Y28TZB9m3XVTPz5zYafJatjJq5mFXp 0mD7QP0EdQEZGtrpG9yvEQKaJS3nCa2H+LkSYj1e1K2XZMDK6Cfb1gv5EBcvI7WgjnEI Tg2/cHsQ52wl/sSK03mlRPGcNoYOaCLjGaDyD3dvvtpZeUxOCqo93PWSj2D+IqXsui65 8VGQ== X-Gm-Message-State: AMCzsaVyW4F9RO1KC0abonYlEg0cJ1KXyrWQ8ffqfXLM9Q0zxC/pmynA O4/uXQSk7CymMBKKD8RJD6Z5gB+iDPE= X-Google-Smtp-Source: ABhQp+QIGWoFZuz7AliFXitswKPyqpAIG5sx+0gU59fSU4DR5qhuUm7XrXcMqTolnPKSjtEOOE6a5w== X-Received: by 10.25.160.201 with SMTP id j192mr5207653lfe.145.1508330019445; Wed, 18 Oct 2017 05:33:39 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:38 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:22 +0300 Message-Id: <1847b7ba7015a7448079c2d8fd7187726c33c707.1508329282.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: [Qemu-devel] [PULL 08/10] linux-user: Fix target FS_IOC_GETFLAGS and FS_IOC_SETFLAGS numbers 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: Peter Maydell Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Maydell We were defining TARGET_FS_IOC_GETFLAGS and TARGET_FS_IOC_SETFLAGS using the host 'long' type in the size field, which meant that they had the wrong values if the host and guest had different sized longs. Switch to abi_long instead. This fixes a bug where these ioctls don't work on 32-bit guests on 64-bit hosts (and makes the LTP test 'setxattr03' pass where it did not previously.) Reported-by: pgndev Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Signed-off-by: Riku Voipio --- linux-user/syscall_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 6e2287e918..447915cf80 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -1101,8 +1101,8 @@ struct target_pollfd { /* Note that the ioctl numbers claim type "long" but the actual type * used by the kernel is "int". */ -#define TARGET_FS_IOC_GETFLAGS TARGET_IOR('f', 1, long) -#define TARGET_FS_IOC_SETFLAGS TARGET_IOW('f', 2, long) +#define TARGET_FS_IOC_GETFLAGS TARGET_IOR('f', 1, abi_long) +#define TARGET_FS_IOC_SETFLAGS TARGET_IOW('f', 2, abi_long) #define TARGET_FS_IOC_FIEMAP TARGET_IOWR('f',11,struct fiemap)