From patchwork Thu Dec 13 01:29:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Bowler X-Patchwork-Id: 10727475 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E82FD13AF for ; Thu, 13 Dec 2018 01:26:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D54362B849 for ; Thu, 13 Dec 2018 01:26:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C951A2B74C; Thu, 13 Dec 2018 01:26:48 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5122C2B74C for ; Thu, 13 Dec 2018 01:26:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726526AbeLMB0r (ORCPT ); Wed, 12 Dec 2018 20:26:47 -0500 Received: from mail-it1-f196.google.com ([209.85.166.196]:40837 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726337AbeLMB0q (ORCPT ); Wed, 12 Dec 2018 20:26:46 -0500 Received: by mail-it1-f196.google.com with SMTP id h193so1387447ita.5 for ; Wed, 12 Dec 2018 17:26:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=draconx-ca.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=/2h0iIA8rbAi1vfPAZbtgyfL5jSYqvTvhVkSQhUmqYw=; b=2B0gNbN7wRhAXa7lZEbcxYdXAX85jWE0a5OX+AmZr9CwIVqT5kPnaAVYOUOEQvHsl1 Ixyz5DszqoVCh/NpQQY0SiMD3KJhZMWlnP7wnshl5l9hqq7t81qgFiEkQgRaKMnoLpXS xs0cl8bMBJfo70uOr3fUfMWnXY24e+Z2jC3UTGYWoD0FSJuTXClRWbjCTaS9PRYOlDPf TKXJsY5hQln+9yUUusf5Opi7pb+5pxwmA1QDJ/pSuXZwSri8tCNEjrbYEOOLXJmk6kKv h6iLd5X3Qz/Bxvi7G0Xj6wui5inoP5Lh9bCHR6qfg2LWotxcnMbblI+glAZIrlBvxUA/ nRlQ== 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; bh=/2h0iIA8rbAi1vfPAZbtgyfL5jSYqvTvhVkSQhUmqYw=; b=dr9KanE2d+ujaLkmSaxc2W92jbuyqtuODeFwssN2kIZ9CClJfXHlRV6IB6nk50/8Tn Vz74tzsNomnLHILH8TQRJT9yeEtcbA1BTsG/81Vp8TZ4ybgBayxs8Rn3gMzcSq7P17mV vP9uVSZnjUnytBDBPo5b5fVUhwWw8gJQqEHeRj3kguSUtvpL8D3gYrpCqj2+xF00p74d dgIFSNPPaFmR4CydrDsgeyCTbtbjBCQz1kL7d0blcYb/tkgLSTUCKjchgGzS4i+B0tCM DzTgWFU1w1x77XdOliqZk8S4Yp3eUN5St4YBjuhtC1NRZZaBhu/oQocHTZL0x3Ajmkao MR4Q== X-Gm-Message-State: AA+aEWa7gtk++zTZaopqMq0ll2Bx/m94oMi1GLWjR0EaJSdeiuyfR1yL FboRmior7/o8eSc7+4AEJeV2KrL+37nyPCWQqDE= X-Google-Smtp-Source: AFSGD/U425sep6u7W51310UX+O1WXz+zaMg1SqeWzrlPKp/8xJ7o1THy5CUT1gVdVh3R8efVA4hwXw== X-Received: by 2002:a24:7609:: with SMTP id z9mr8866808itb.66.1544664405225; Wed, 12 Dec 2018 17:26:45 -0800 (PST) Received: from localhost (ip-24-156-181-89.user.start.ca. [24.156.181.89]) by smtp.gmail.com with ESMTPSA id b24sm174625ioj.57.2018.12.12.17.26.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Dec 2018 17:26:44 -0800 (PST) From: Nick Bowler To: linux-xfs@vger.kernel.org Cc: Brian Foster , Dave Chinner , "Darrick J. Wong" Subject: [RFC PATCH 0/2] Fixing xfs ioctls on x32 Date: Wed, 12 Dec 2018 20:29:58 -0500 Message-Id: <20181213013000.15716-1-nbowler@draconx.ca> X-Mailer: git-send-email 2.16.1 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP An error I got running xfs_growfs on my x32 system opened this can of worms... This series is intended to fix all XFS ioctls which don't work from x32 userspace applications. Test is xfstests "check -g quick", excluding generic/081 and xfs/014 which don't behave well for me and don't seem related to XFS ioctls. Note that glibc's fallocate wrapper appears to be buggy on x32, which causes several test failures. I hacked around that in xfs_io (the fallocate syscall itself appears to work perfectly fine on x32) to get a cleaner test run. Obviously this bug should be fixed but it doesn't appear to be a kernel or xfsprogs problem. All tests are running with the same 4.20-rc6 kernel, but different userspace installations (pure x32 versus pure i686). The "After" results are obtained by reloading the xfs.ko kernel module with the patched version and running the same set of tests. All the remaining failures on x32 appear to be aio related, or are also failing on the i686 tests. I have no experience with aio but I'm going to assume those problems have nothing to do with ioctl. Before (i686 w/ 64bit kernel): Failures: generic/484 xfs/191-input-validation xfs/269 xfs/495 Failed 4 of 656 tests Before (x32): Failures: generic/018 generic/075 generic/079 generic/112 generic/113 generic/114 generic/198 generic/207 generic/210 generic/240 generic/252 generic/386 generic/427 generic/451 generic/465 generic/484 xfs/002 xfs/009 xfs/026 xfs/027 xfs/028 xfs/046 xfs/054 xfs/056 xfs/059 xfs/060 xfs/062 xfs/063 xfs/066 xfs/069 xfs/072 xfs/078 xfs/106 xfs/118 xfs/164 xfs/165 xfs/166 xfs/170 xfs/190 xfs/191-input-validation xfs/195 xfs/250 xfs/266 xfs/269 xfs/281 xfs/282 xfs/283 xfs/289 xfs/296 xfs/443 xfs/449 xfs/495 Failed 52 of 656 tests After (i686 w/ 64bit kernel): Failures: generic/484 xfs/191-input-validation xfs/269 xfs/495 Failed 4 of 656 tests After (x32): Failures: generic/112 generic/113 generic/114 generic/198 generic/207 generic/210 generic/240 generic/252 generic/427 generic/451 generic/465 generic/484 xfs/191-input-validation xfs/269 xfs/495 Failed 15 of 656 tests Nick Bowler (2): xfs: Fix bulkstat compat ioctls on x32 userspace. xfs: Fix x32 ioctls when cmd numbers differ from ia32. fs/xfs/xfs_ioctl32.c | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-)