From patchwork Thu Aug 1 01:42:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11069901 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 5DA1413B1 for ; Thu, 1 Aug 2019 01:42:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C83A283B2 for ; Thu, 1 Aug 2019 01:42:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F417283C5; Thu, 1 Aug 2019 01:42:51 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable 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 03725283AF for ; Thu, 1 Aug 2019 01:42:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729447AbfHABmu (ORCPT ); Wed, 31 Jul 2019 21:42:50 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:42390 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726622AbfHABmu (ORCPT ); Wed, 31 Jul 2019 21:42:50 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x711Y7wO077000; Thu, 1 Aug 2019 01:42:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=mxD+S2pjBUXiq4hrP1gUUp9ZxwyAZ8rSHU5LeZW83n4=; b=BNiEuHu/dBgnd67Ec50oDmoWSHx/pYkwXB65L5yXIu3FOSHCLathmaXPQ5RbGpoJGiYb rEOFe/gnonzuZvkIPCPmZuIfe09cmhMowb1e8H96uu79ocyG6Sc+jdx7/RzJBf5RC7IH CLyihb+0mD7uGSL6u8eiTq5CNo2ytLpuVlHuJeGqBMNr+qDhQQypz7bTNe/bD2ggmjzB 12GsiZs+QnkkLlse0JFkH5ZWhWFmHLtelpsd3lMvTun9ON0O7PDflcWU5Hz71KqBUKss rjjkjnGLcZoX8TZMIJDZBfCHd+bwHvBPaB2fZ2zwLVnpblRg90F6kxLkvqR4ZOuoHQs6 aA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2u0f8r8ghn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Aug 2019 01:42:44 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x711Wvnp145589; Thu, 1 Aug 2019 01:42:43 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 2u349df6c1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Aug 2019 01:42:43 +0000 Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x711ggYM001317; Thu, 1 Aug 2019 01:42:42 GMT Received: from localhost (/10.159.254.175) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Aug 2019 01:42:42 +0000 Subject: [PATCH 1/5] xfs/122: ignore inode geometry structure From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, bfoster@redhat.com, fstests@vger.kernel.org Date: Wed, 31 Jul 2019 18:42:41 -0700 Message-ID: <156462376150.2945299.17354409699083869260.stgit@magnolia> In-Reply-To: <156462375516.2945299.16564635037236083118.stgit@magnolia> References: <156462375516.2945299.16564635037236083118.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9335 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908010012 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9335 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908010012 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 From: Darrick J. Wong Ignore new in-core structure. Signed-off-by: Darrick J. Wong --- tests/xfs/122 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/xfs/122 b/tests/xfs/122 index b66b78a6..89a39a23 100755 --- a/tests/xfs/122 +++ b/tests/xfs/122 @@ -177,6 +177,7 @@ xfs_dirent_t xfs_fsop_getparents_handlereq_t xfs_dinode_core_t struct xfs_iext_cursor +struct xfs_ino_geometry EOF echo 'int main(int argc, char *argv[]) {' >>$cprog From patchwork Thu Aug 1 01:42:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11069905 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 3F1A614DB for ; Thu, 1 Aug 2019 01:43:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31A81283C8 for ; Thu, 1 Aug 2019 01:43:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21E8F283B2; Thu, 1 Aug 2019 01:43:06 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable 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 D63A2283AF for ; Thu, 1 Aug 2019 01:43:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729459AbfHABnF (ORCPT ); Wed, 31 Jul 2019 21:43:05 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:42630 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726622AbfHABnF (ORCPT ); Wed, 31 Jul 2019 21:43:05 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x711Y7Hv076893; Thu, 1 Aug 2019 01:42:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=dj2cUoNeoGCN5tGmPKKeh+Fl0a9HZKDVwjhHyFxRk+U=; b=FQf+ZFl/cHI7YtVx8seXxfjI0jjSvV3yE28MENKX7415niwST7PxuroEXOp1S8OykJSM oerf+mxtHu9VmjCKgVpvLo9bGOj80F1SkM0pKg5VornSDIPAJ9hGwDn7cwd5ZKHI7okK OZ1WTjgN7t0YwSs3NL2sYo0V2CuxoLpy6yLKqYFv16cjq+jUG0hh03QU8jkCIXXLH2wg L3cRRLniu0KbI7HMT3FgGzRkaIpDBifxrJzXUXibJ85N+rV9hfedavTB/9ce9/3a1EJ2 +OyJXLZw5Mf9vtk1DH4qCP8LKk27vp2HEovBTHNAmZfN59YHDYbZzeLkyV0Yhhgp2kBd qA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2u0f8r8gj7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Aug 2019 01:42:54 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x711WqcC145432; Thu, 1 Aug 2019 01:42:53 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 2u349df6eg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Aug 2019 01:42:53 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x711gqtr001437; Thu, 1 Aug 2019 01:42:52 GMT Received: from localhost (/10.159.254.175) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 31 Jul 2019 18:42:51 -0700 Subject: [PATCH 2/5] xfs/122: mask wonky ioctls From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, bfoster@redhat.com, fstests@vger.kernel.org Date: Wed, 31 Jul 2019 18:42:47 -0700 Message-ID: <156462376770.2945299.14876549345616514182.stgit@magnolia> In-Reply-To: <156462375516.2945299.16564635037236083118.stgit@magnolia> References: <156462375516.2945299.16564635037236083118.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9335 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=880 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908010012 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9335 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=937 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908010012 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 From: Darrick J. Wong Don't check the structure size of the inogrp/bstat/fsop_bulkreq structures because they're incorrectly padded. When we remove the old typdefs the old filter stops working. Signed-off-by: Darrick J. Wong --- tests/xfs/122 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/xfs/122 b/tests/xfs/122 index 89a39a23..64b63cb1 100755 --- a/tests/xfs/122 +++ b/tests/xfs/122 @@ -148,12 +148,15 @@ xfs_growfs_data_t xfs_growfs_rt_t xfs_bstime_t xfs_bstat_t +struct xfs_bstat xfs_fsop_bulkreq_t +struct xfs_fsop_bulkreq xfs_icsb_cnts_t xfs_icdinode_t xfs_ictimestamp_t xfs_inobt_rec_incore_t xfs_inogrp_t +struct xfs_inogrp xfs_fid2_t xfs_fsop_handlereq_t xfs_fsop_setdm_handlereq_t From patchwork Thu Aug 1 01:42:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11069907 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 7CD13912 for ; Thu, 1 Aug 2019 01:43:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71471283C8 for ; Thu, 1 Aug 2019 01:43:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65926283C5; Thu, 1 Aug 2019 01:43:14 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable 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 23242283AF for ; Thu, 1 Aug 2019 01:43:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726514AbfHABnN (ORCPT ); Wed, 31 Jul 2019 21:43:13 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:43372 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbfHABnN (ORCPT ); Wed, 31 Jul 2019 21:43:13 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x711YF84073908; Thu, 1 Aug 2019 01:43:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=Av7O1H2c5HTAjkGwCwww+rrRWVyHRJOli72e1cGOcuc=; b=FjucyxvKAb080Mntugck0Qn28bmustNt8FdG4r1H21LiqI2vcif1ueP+VAoAtwWj42Ze b0QQKLpy8rPWNH5qTaYAkczni3egc+fV/SzrOwKWgeA12n6LMaG8JFoshtCmGjgq7Yfn txPaidYGjkjboUekW8wvB+vS1olJ1AtNcEseRN6NyyRJpEMGPHoU39CULVNXxCrCXSvI WWLXx5eA0hoyern8tPhQbIFcCuM+0+HlxbEHi1gcakeWC2dfcENbkABUdjwUMAAYbgP2 D3rMXvW5K8l/ux0xk7EtD2HCf3O71LyzSpcOf0nLqMR7LJ5UL+5x9/nGJ9nxYjPLAyh2 ag== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2u0e1u0qtq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Aug 2019 01:43:01 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x711WvEx103796; Thu, 1 Aug 2019 01:43:00 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 2u2jp5nuds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Aug 2019 01:43:00 +0000 Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x711gxrK023105; Thu, 1 Aug 2019 01:42:59 GMT Received: from localhost (/10.159.254.175) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 31 Jul 2019 18:42:58 -0700 Subject: [PATCH 3/5] xfs/122: add the new v5 bulkstat/inumbers ioctl structures From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, bfoster@redhat.com, fstests@vger.kernel.org Date: Wed, 31 Jul 2019 18:42:57 -0700 Message-ID: <156462377790.2945299.5915136628365061851.stgit@magnolia> In-Reply-To: <156462375516.2945299.16564635037236083118.stgit@magnolia> References: <156462375516.2945299.16564635037236083118.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9335 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=985 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908010012 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9335 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908010012 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 From: Darrick J. Wong The new v5 bulkstat and inumbers structures are correctly padded so that no format changes are necessary across platforms, so add them to the output. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster --- tests/xfs/122.out | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/xfs/122.out b/tests/xfs/122.out index cf9ac9e2..d2d5a184 100644 --- a/tests/xfs/122.out +++ b/tests/xfs/122.out @@ -66,6 +66,9 @@ sizeof(struct xfs_btree_block_lhdr) = 64 sizeof(struct xfs_btree_block_shdr) = 48 sizeof(struct xfs_bud_log_format) = 16 sizeof(struct xfs_bui_log_format) = 16 +sizeof(struct xfs_bulk_ireq) = 64 +sizeof(struct xfs_bulkstat) = 192 +sizeof(struct xfs_bulkstat_req) = 64 sizeof(struct xfs_clone_args) = 32 sizeof(struct xfs_cud_log_format) = 16 sizeof(struct xfs_cui_log_format) = 16 @@ -89,6 +92,8 @@ sizeof(struct xfs_fsop_geom_v4) = 112 sizeof(struct xfs_icreate_log) = 28 sizeof(struct xfs_inode_log_format) = 56 sizeof(struct xfs_inode_log_format_32) = 52 +sizeof(struct xfs_inumbers) = 24 +sizeof(struct xfs_inumbers_req) = 64 sizeof(struct xfs_log_dinode) = 176 sizeof(struct xfs_map_extent) = 32 sizeof(struct xfs_phys_extent) = 16 From patchwork Thu Aug 1 01:43:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11069913 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 4574114DB for ; Thu, 1 Aug 2019 01:43:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3942E283C3 for ; Thu, 1 Aug 2019 01:43:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B5AD28419; Thu, 1 Aug 2019 01:43:26 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable 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 2C2AA283C9 for ; Thu, 1 Aug 2019 01:43:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727998AbfHABnY (ORCPT ); Wed, 31 Jul 2019 21:43:24 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:50394 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbfHABnY (ORCPT ); Wed, 31 Jul 2019 21:43:24 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x711Y7K3155713; Thu, 1 Aug 2019 01:43:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=pkXpqhaw36NG9VT8YLc3m4Eejeg6jrTNQR/Ub+CzEp4=; b=cOZ/BG9QbJia5SoV+CtXgyh9kQSMTXu7nqQ+/uAdv04/RRFHP7/zZwHk7tcDdcOc4/bM 4px+PpyUcBan9XMcH5Jn+dbHeXKNGR4aEeYDxYHXCVoFDzROEklwTxmSdvC8QCgtrLpT uXNjS/4PznohnIW4yWmfKaghxoAYsf7VZJKwRC8ehJXKQ5Soc5k7ntHxeg3NrReBQUbn o7bRJoZK3rWyDRGn7Cd9SgKFauCbMWKBEP8Rkw/tC9mdDi8nnIetQn2Ejc+1qVVzIOyO TagZxzej6ydk1LKK3DhAKjMwgSwXjCVizylAjH40EunqqYrY90rt60d+TT+a0A4Owxvx 8A== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2u0ejprhhf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Aug 2019 01:43:07 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x711WrLT103728; Thu, 1 Aug 2019 01:43:06 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 2u2jp5nufg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Aug 2019 01:43:06 +0000 Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x711h5Jn011301; Thu, 1 Aug 2019 01:43:05 GMT Received: from localhost (/10.159.254.175) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 31 Jul 2019 18:43:05 -0700 Subject: [PATCH 4/5] common/xfs: refactor agcount calculation for mounted filesystems From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, bfoster@redhat.com, fstests@vger.kernel.org Date: Wed, 31 Jul 2019 18:43:04 -0700 Message-ID: <156462378413.2945299.7028294865508807696.stgit@magnolia> In-Reply-To: <156462375516.2945299.16564635037236083118.stgit@magnolia> References: <156462375516.2945299.16564635037236083118.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9335 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908010012 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9335 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908010012 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 From: Darrick J. Wong Create a helper function to return the number of AGs of a mounted filesystem so that we can get rid of the open-coded versions in various tests. The new helper will be used in a subsequent patch. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster --- common/xfs | 6 ++++++ tests/xfs/085 | 2 +- tests/xfs/086 | 2 +- tests/xfs/087 | 2 +- tests/xfs/088 | 2 +- tests/xfs/089 | 2 +- tests/xfs/091 | 2 +- tests/xfs/093 | 2 +- tests/xfs/097 | 2 +- tests/xfs/130 | 2 +- tests/xfs/235 | 2 +- tests/xfs/271 | 2 +- 12 files changed, 17 insertions(+), 11 deletions(-) diff --git a/common/xfs b/common/xfs index 2b38e94b..1bce3c18 100644 --- a/common/xfs +++ b/common/xfs @@ -878,3 +878,9 @@ _force_xfsv4_mount_options() fi echo "MOUNT_OPTIONS = $MOUNT_OPTIONS" >>$seqres.full } + +# Find AG count of mounted filesystem +_xfs_mount_agcount() +{ + $XFS_INFO_PROG "$1" | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g' +} diff --git a/tests/xfs/085 b/tests/xfs/085 index 23095413..18ddeff8 100755 --- a/tests/xfs/085 +++ b/tests/xfs/085 @@ -63,7 +63,7 @@ for x in `seq 2 64`; do touch "${TESTFILE}.${x}" done inode="$(stat -c '%i' "${TESTFILE}.1")" -agcount="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g')" +agcount="$(_xfs_mount_agcount $SCRATCH_MNT)" umount "${SCRATCH_MNT}" echo "+ check fs" diff --git a/tests/xfs/086 b/tests/xfs/086 index 8602a565..7429d39d 100755 --- a/tests/xfs/086 +++ b/tests/xfs/086 @@ -64,7 +64,7 @@ for x in `seq 2 64`; do touch "${TESTFILE}.${x}" done inode="$(stat -c '%i' "${TESTFILE}.1")" -agcount="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g')" +agcount="$(_xfs_mount_agcount $SCRATCH_MNT)" test "${agcount}" -gt 1 || _notrun "Single-AG XFS not supported" umount "${SCRATCH_MNT}" diff --git a/tests/xfs/087 b/tests/xfs/087 index ede8e447..b3d3bca9 100755 --- a/tests/xfs/087 +++ b/tests/xfs/087 @@ -64,7 +64,7 @@ for x in `seq 2 64`; do touch "${TESTFILE}.${x}" done inode="$(stat -c '%i' "${TESTFILE}.1")" -agcount="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g')" +agcount="$(_xfs_mount_agcount $SCRATCH_MNT)" umount "${SCRATCH_MNT}" echo "+ check fs" diff --git a/tests/xfs/088 b/tests/xfs/088 index 6f36efab..74b45163 100755 --- a/tests/xfs/088 +++ b/tests/xfs/088 @@ -64,7 +64,7 @@ for x in `seq 2 64`; do touch "${TESTFILE}.${x}" done inode="$(stat -c '%i' "${TESTFILE}.1")" -agcount="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g')" +agcount="$(_xfs_mount_agcount $SCRATCH_MNT)" umount "${SCRATCH_MNT}" echo "+ check fs" diff --git a/tests/xfs/089 b/tests/xfs/089 index 5c398299..bcbc6363 100755 --- a/tests/xfs/089 +++ b/tests/xfs/089 @@ -64,7 +64,7 @@ for x in `seq 2 64`; do touch "${TESTFILE}.${x}" done inode="$(stat -c '%i' "${TESTFILE}.1")" -agcount="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g')" +agcount="$(_xfs_mount_agcount $SCRATCH_MNT)" umount "${SCRATCH_MNT}" echo "+ check fs" diff --git a/tests/xfs/091 b/tests/xfs/091 index 5d6cd363..be56d8ae 100755 --- a/tests/xfs/091 +++ b/tests/xfs/091 @@ -64,7 +64,7 @@ for x in `seq 2 64`; do touch "${TESTFILE}.${x}" done inode="$(stat -c '%i' "${TESTFILE}.1")" -agcount="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g')" +agcount="$(_xfs_mount_agcount $SCRATCH_MNT)" umount "${SCRATCH_MNT}" echo "+ check fs" diff --git a/tests/xfs/093 b/tests/xfs/093 index e09e8499..4c4fbdc4 100755 --- a/tests/xfs/093 +++ b/tests/xfs/093 @@ -64,7 +64,7 @@ for x in `seq 2 64`; do touch "${TESTFILE}.${x}" done inode="$(stat -c '%i' "${TESTFILE}.1")" -agcount="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g')" +agcount="$(_xfs_mount_agcount $SCRATCH_MNT)" umount "${SCRATCH_MNT}" echo "+ check fs" diff --git a/tests/xfs/097 b/tests/xfs/097 index db355de6..68eae1d4 100755 --- a/tests/xfs/097 +++ b/tests/xfs/097 @@ -67,7 +67,7 @@ for x in `seq 2 64`; do touch "${TESTFILE}.${x}" done inode="$(stat -c '%i' "${TESTFILE}.1")" -agcount="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g')" +agcount="$(_xfs_mount_agcount $SCRATCH_MNT)" umount "${SCRATCH_MNT}" echo "+ check fs" diff --git a/tests/xfs/130 b/tests/xfs/130 index 71c1181f..f15366a6 100755 --- a/tests/xfs/130 +++ b/tests/xfs/130 @@ -43,7 +43,7 @@ _scratch_mkfs_xfs > /dev/null echo "+ mount fs image" _scratch_mount blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")" -agcount="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g')" +agcount="$(_xfs_mount_agcount $SCRATCH_MNT)" echo "+ make some files" _pwrite_byte 0x62 0 $((blksz * 64)) "${SCRATCH_MNT}/file0" >> "$seqres.full" diff --git a/tests/xfs/235 b/tests/xfs/235 index 669f58b0..64b0a0b5 100755 --- a/tests/xfs/235 +++ b/tests/xfs/235 @@ -41,7 +41,7 @@ _scratch_mkfs_xfs > /dev/null echo "+ mount fs image" _scratch_mount blksz=$(stat -f -c '%s' ${SCRATCH_MNT}) -agcount=$($XFS_INFO_PROG ${SCRATCH_MNT} | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g') +agcount=$(_xfs_mount_agcount $SCRATCH_MNT) echo "+ make some files" _pwrite_byte 0x62 0 $((blksz * 64)) ${SCRATCH_MNT}/file0 >> $seqres.full diff --git a/tests/xfs/271 b/tests/xfs/271 index db14bfec..38844246 100755 --- a/tests/xfs/271 +++ b/tests/xfs/271 @@ -37,7 +37,7 @@ echo "Format and mount" _scratch_mkfs > "$seqres.full" 2>&1 _scratch_mount -agcount=$($XFS_INFO_PROG $SCRATCH_MNT | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g') +agcount=$(_xfs_mount_agcount $SCRATCH_MNT) echo "Get fsmap" | tee -a $seqres.full $XFS_IO_PROG -c 'fsmap -v' $SCRATCH_MNT > $TEST_DIR/fsmap From patchwork Thu Aug 1 01:43:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11069917 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 ECAF114DB for ; Thu, 1 Aug 2019 01:43:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0691283B0 for ; Thu, 1 Aug 2019 01:43:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB6E628419; Thu, 1 Aug 2019 01:43:30 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable 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 55813283B0 for ; Thu, 1 Aug 2019 01:43:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729471AbfHABn2 (ORCPT ); Wed, 31 Jul 2019 21:43:28 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:43618 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbfHABn2 (ORCPT ); Wed, 31 Jul 2019 21:43:28 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x711YVhU073952; Thu, 1 Aug 2019 01:43:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=aNC5KkFy0SBJsFt8u9VWI1gL89nUC+PjjCczDiBFlno=; b=zc6lrep1Hp+eAGMOpTezgA0328WHLyZ6TcmaFEvz6J3FOKMdjfxCGfTWE67zVhOEBD5E JOt53u8wHT3AspwYbAGo/HAa4Y90CtDwel6RXr9eR4JLtzXS4fmVVA5k6At9xuD2vYpn FfUuoytcauBNUGfWkpLMTDhdDRo1pLkOCRg5wzBpYFtBIBvXnzIntHAMBbSeOE9gAZlR xWZnRln7LCBAcLLXPNU3kca6AsdGKdTEInxh0JPlvogKo6rKo0jnWLonrY8kI3D1lckV Rs/45gHZNv6Dds7SRqz5tkIQjuep5B3oUF0ONLeYaAmuX6WgpRWTXjCrwkkT01cZ9i6k 1w== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2u0e1u0quh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Aug 2019 01:43:13 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x711WpvJ146811; Thu, 1 Aug 2019 01:43:12 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2u3mbtkb65-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Aug 2019 01:43:12 +0000 Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x711hBt8011322; Thu, 1 Aug 2019 01:43:12 GMT Received: from localhost (/10.159.254.175) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Aug 2019 01:43:11 +0000 Subject: [PATCH 5/5] xfs: test new v5 bulkstat commands From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, bfoster@redhat.com, fstests@vger.kernel.org Date: Wed, 31 Jul 2019 18:43:10 -0700 Message-ID: <156462379043.2945299.17354996626313190310.stgit@magnolia> In-Reply-To: <156462375516.2945299.16564635037236083118.stgit@magnolia> References: <156462375516.2945299.16564635037236083118.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9335 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908010012 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9335 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908010012 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 From: Darrick J. Wong Check that the new v5 bulkstat commands do everything the old one do, and then make sure the new functionality actually works. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster --- .gitignore | 1 src/Makefile | 2 src/bulkstat_null_ocount.c | 61 +++++++++ tests/xfs/744 | 215 ++++++++++++++++++++++++++++++++ tests/xfs/744.out | 297 ++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/745 | 47 +++++++ tests/xfs/745.out | 2 tests/xfs/group | 2 8 files changed, 626 insertions(+), 1 deletion(-) create mode 100644 src/bulkstat_null_ocount.c create mode 100755 tests/xfs/744 create mode 100644 tests/xfs/744.out create mode 100755 tests/xfs/745 create mode 100644 tests/xfs/745.out diff --git a/.gitignore b/.gitignore index 11232be7..c8c815f9 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,7 @@ /src/attr_replace_test /src/attr-list-by-handle-cursor-test /src/bstat +/src/bulkstat_null_ocount /src/bulkstat_unlink_test /src/bulkstat_unlink_test_modified /src/cloner diff --git a/src/Makefile b/src/Makefile index 9d3d2529..c4fcf370 100644 --- a/src/Makefile +++ b/src/Makefile @@ -28,7 +28,7 @@ LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \ attr-list-by-handle-cursor-test listxattr dio-interleaved t_dir_type \ dio-invalidate-cache stat_test t_encrypted_d_revalidate \ attr_replace_test swapon mkswap t_attr_corruption t_open_tmpfiles \ - fscrypt-crypt-util + fscrypt-crypt-util bulkstat_null_ocount SUBDIRS = log-writes perf diff --git a/src/bulkstat_null_ocount.c b/src/bulkstat_null_ocount.c new file mode 100644 index 00000000..b8f8fd39 --- /dev/null +++ b/src/bulkstat_null_ocount.c @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Oracle. All Rights Reserved. + * Author: Darrick J. Wong + * + * Ensure the kernel returns the new lastip even when ocount is null. + */ +#include +#include +#include +#include +#include +#include +#include +#include + +static void die(const char *tag) +{ + perror(tag); + exit(1); +} + +int main(int argc, char *argv[]) +{ + struct xfs_bstat bstat; + __u64 last; + struct xfs_fsop_bulkreq bulkreq = { + .lastip = &last, + .icount = 1, + .ubuffer = &bstat, + .ocount = NULL, + }; + int ret; + int fd; + + fd = open(argv[1], O_RDONLY); + if (fd < 0) + die(argv[1]); + + last = 0; + ret = ioctl(fd, XFS_IOC_FSINUMBERS, &bulkreq); + if (ret) + die("inumbers"); + + if (last == 0) + printf("inumbers last = %llu\n", (unsigned long long)last); + + last = 0; + ret = ioctl(fd, XFS_IOC_FSBULKSTAT, &bulkreq); + if (ret) + die("bulkstat"); + + if (last == 0) + printf("bulkstat last = %llu\n", (unsigned long long)last); + + ret = close(fd); + if (ret) + die("close"); + + return 0; +} diff --git a/tests/xfs/744 b/tests/xfs/744 new file mode 100755 index 00000000..182c6ee5 --- /dev/null +++ b/tests/xfs/744 @@ -0,0 +1,215 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2014 Red Hat, Inc. All Rights Reserved. +# Copyright (c) 2019 Oracle, Inc. All Rights Reserved. +# +# FS QA Test No. 744 +# +# Use the xfs_io bulkstat utility to verify bulkstat finds all inodes in a +# filesystem. Test under various inode counts, inobt record layouts and +# bulkstat batch sizes. Test v1 and v5 ioctls explicitly, as well as the +# ioctl version autodetection code in libfrog. +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +bstat_versions() +{ + echo "default" + echo "v1 -v1" + if [ -n "$has_v5" ]; then + echo "v5 -v5" + else + echo "v5" + fi +} + +# Print the number of inodes counted by bulkstat +bstat_count() +{ + local batchsize="$1" + local tag="$2" + + bstat_versions | while read v_tag v_flag; do + echo "$tag($v_tag): passing \"$v_flag\" to bulkstat" >> $seqres.full + echo -n "bulkstat $tag($v_tag): " + $XFS_IO_PROG -c "bulkstat -n $batchsize $v_flag" $SCRATCH_MNT | grep ino | wc -l + done +} + +# Print the number of inodes counted by per-ag bulkstat +bstat_perag_count() +{ + local batchsize="$1" + local tag="$2" + + local agcount=$(_xfs_mount_agcount $SCRATCH_MNT) + + bstat_versions | while read v_tag v_flag; do + echo -n "bulkstat $tag($v_tag): " + seq 0 $((agcount - 1)) | while read ag; do + $XFS_IO_PROG -c "bulkstat -a $ag -n $batchsize $v_flag" $SCRATCH_MNT + done | grep ino | wc -l + done +} + +# Sum the number of allocated inodes in each AG in a fs. +inumbers_ag() +{ + local agcount="$1" + local batchsize="$2" + local mount="$3" + local v_flag="$4" + + seq 0 $((agcount - 1)) | while read ag; do + $XFS_IO_PROG -c "inumbers -a $ag -n $batchsize $v_flag" $mount + done | grep alloccount | awk '{x += $3} END { print(x) }' +} + +# Sum the number of allocated inodes in the whole fs all at once. +inumbers_fs() +{ + local dir="$1" + local v_flag="$2" + + $XFS_IO_PROG -c "inumbers $v_flag" "$dir" | grep alloccount | \ + awk '{x += $3} END { print(x) }' +} + +# Print the number of inodes counted by inumbers +inumbers_count() +{ + local expect="$1" + + # There probably aren't more than 10 hidden inodes, right? + local tolerance=10 + + # Force all background unlinked inode cleanup to run so that we don't + # race changes to the inode btree with our inumbers query. + _scratch_cycle_mount + + bstat_versions | while read v_tag v_flag; do + echo -n "inumbers all($v_tag): " + nr=$(inumbers_fs $SCRATCH_MNT $v_flag) + _within_tolerance "inumbers" $nr $expect $tolerance -v + + local agcount=$(_xfs_mount_agcount $SCRATCH_MNT) + for batchsize in 71 2 1; do + echo -n "inumbers $batchsize($v_tag): " + nr=$(inumbers_ag $agcount $batchsize $SCRATCH_MNT $v_flag) + _within_tolerance "inumbers" $nr $expect $tolerance -v + done + done +} + +# Compare the src/bstat output against the xfs_io bstat output. +# This compares the actual inode numbers output by one tool against another, +# so we can't easily put the output in the golden output. +bstat_compare() +{ + bstat_versions | while read v_tag v_flag; do + diff -u <(./src/bstat $SCRATCH_MNT | grep ino | awk '{print $2}') \ + <($XFS_IO_PROG -c "bulkstat $v_flag" $SCRATCH_MNT | grep ino | awk '{print $3}') + done +} + +# Print bulkstat counts using varied batch sizes +bstat_test() +{ + expect=`find $SCRATCH_MNT -print | wc -l` + echo + echo "expect $expect" + + for sz in 4096 71 32 1; do + bstat_count $sz "$sz all" + bstat_perag_count $sz "$sz perag" + bstat_compare + inumbers_count $expect + done +} + +# Get standard environment, filters and checks +. ./common/rc +. ./common/filter + +_require_scratch +_require_xfs_io_command bulkstat +_require_xfs_io_command bulkstat_single +_require_xfs_io_command inumbers + +# Real QA test starts here + +_supported_fs xfs +_supported_os Linux + +rm -f $seqres.full + +DIRCOUNT=8 +INOCOUNT=$((2048 / DIRCOUNT)) + +_scratch_mkfs "-d agcount=$DIRCOUNT" >> $seqres.full 2>&1 || _fail "mkfs failed" +_scratch_mount + +# Figure out if we have v5 bulkstat/inumbers ioctls. +has_v5= +bs_root_out="$($XFS_IO_PROG -c 'bulkstat_single root' $SCRATCH_MNT 2>>$seqres.full)" +test -n "$bs_root_out" && has_v5=1 + +echo "this will be 1 if we have v5 bulkstat: $has_v5" >> $seqres.full + +# If v5 bulkstat is present, query the root inode and compare it to the stat +# output of $SCRATCH_MNT to make sure it gave us the correct number +if [ -n "$has_v5" ]; then + bs_root=$(echo "$bs_root_out" | grep ino | awk '{print $3}') + stat_root=$(stat -c '%i' $SCRATCH_MNT) + if [ "$stat_root" -ne "$bs_root" ]; then + echo "stat says root is $stat_root but bulkstat says $bs_root" + fi +fi + +# Create a set of directories and fill each with a fixed number of files +for dir in $(seq 1 $DIRCOUNT); do + mkdir -p $SCRATCH_MNT/$dir + for i in $(seq 1 $INOCOUNT); do + touch $SCRATCH_MNT/$dir/$i + done +done +bstat_test + +# Remove every other file from each dir +for dir in $(seq 1 $DIRCOUNT); do + for i in $(seq 2 2 $INOCOUNT); do + rm -f $SCRATCH_MNT/$dir/$i + done +done +bstat_test + +# Remove the entire second half of files +for dir in $(seq 1 $DIRCOUNT); do + for i in $(seq $((INOCOUNT / 2)) $INOCOUNT); do + rm -f $SCRATCH_MNT/$dir/$i + done +done +bstat_test + +# Remove all regular files +for dir in $(seq 1 $DIRCOUNT); do + rm -f $SCRATCH_MNT/$dir/* +done +bstat_test + +# Success, all done +status=0 +exit diff --git a/tests/xfs/744.out b/tests/xfs/744.out new file mode 100644 index 00000000..ed6b03cf --- /dev/null +++ b/tests/xfs/744.out @@ -0,0 +1,297 @@ +QA output created by 744 + +expect 2057 +bulkstat 4096 all(default): 2057 +bulkstat 4096 all(v1): 2057 +bulkstat 4096 all(v5): 2057 +bulkstat 4096 perag(default): 2057 +bulkstat 4096 perag(v1): 2057 +bulkstat 4096 perag(v5): 2057 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range +bulkstat 71 all(default): 2057 +bulkstat 71 all(v1): 2057 +bulkstat 71 all(v5): 2057 +bulkstat 71 perag(default): 2057 +bulkstat 71 perag(v1): 2057 +bulkstat 71 perag(v5): 2057 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range +bulkstat 32 all(default): 2057 +bulkstat 32 all(v1): 2057 +bulkstat 32 all(v5): 2057 +bulkstat 32 perag(default): 2057 +bulkstat 32 perag(v1): 2057 +bulkstat 32 perag(v5): 2057 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range +bulkstat 1 all(default): 2057 +bulkstat 1 all(v1): 2057 +bulkstat 1 all(v5): 2057 +bulkstat 1 perag(default): 2057 +bulkstat 1 perag(v1): 2057 +bulkstat 1 perag(v5): 2057 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range + +expect 1033 +bulkstat 4096 all(default): 1033 +bulkstat 4096 all(v1): 1033 +bulkstat 4096 all(v5): 1033 +bulkstat 4096 perag(default): 1033 +bulkstat 4096 perag(v1): 1033 +bulkstat 4096 perag(v5): 1033 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range +bulkstat 71 all(default): 1033 +bulkstat 71 all(v1): 1033 +bulkstat 71 all(v5): 1033 +bulkstat 71 perag(default): 1033 +bulkstat 71 perag(v1): 1033 +bulkstat 71 perag(v5): 1033 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range +bulkstat 32 all(default): 1033 +bulkstat 32 all(v1): 1033 +bulkstat 32 all(v5): 1033 +bulkstat 32 perag(default): 1033 +bulkstat 32 perag(v1): 1033 +bulkstat 32 perag(v5): 1033 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range +bulkstat 1 all(default): 1033 +bulkstat 1 all(v1): 1033 +bulkstat 1 all(v5): 1033 +bulkstat 1 perag(default): 1033 +bulkstat 1 perag(v1): 1033 +bulkstat 1 perag(v5): 1033 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range + +expect 521 +bulkstat 4096 all(default): 521 +bulkstat 4096 all(v1): 521 +bulkstat 4096 all(v5): 521 +bulkstat 4096 perag(default): 521 +bulkstat 4096 perag(v1): 521 +bulkstat 4096 perag(v5): 521 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range +bulkstat 71 all(default): 521 +bulkstat 71 all(v1): 521 +bulkstat 71 all(v5): 521 +bulkstat 71 perag(default): 521 +bulkstat 71 perag(v1): 521 +bulkstat 71 perag(v5): 521 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range +bulkstat 32 all(default): 521 +bulkstat 32 all(v1): 521 +bulkstat 32 all(v5): 521 +bulkstat 32 perag(default): 521 +bulkstat 32 perag(v1): 521 +bulkstat 32 perag(v5): 521 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range +bulkstat 1 all(default): 521 +bulkstat 1 all(v1): 521 +bulkstat 1 all(v5): 521 +bulkstat 1 perag(default): 521 +bulkstat 1 perag(v1): 521 +bulkstat 1 perag(v5): 521 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range + +expect 9 +bulkstat 4096 all(default): 9 +bulkstat 4096 all(v1): 9 +bulkstat 4096 all(v5): 9 +bulkstat 4096 perag(default): 9 +bulkstat 4096 perag(v1): 9 +bulkstat 4096 perag(v5): 9 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range +bulkstat 71 all(default): 9 +bulkstat 71 all(v1): 9 +bulkstat 71 all(v5): 9 +bulkstat 71 perag(default): 9 +bulkstat 71 perag(v1): 9 +bulkstat 71 perag(v5): 9 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range +bulkstat 32 all(default): 9 +bulkstat 32 all(v1): 9 +bulkstat 32 all(v5): 9 +bulkstat 32 perag(default): 9 +bulkstat 32 perag(v1): 9 +bulkstat 32 perag(v5): 9 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range +bulkstat 1 all(default): 9 +bulkstat 1 all(v1): 9 +bulkstat 1 all(v5): 9 +bulkstat 1 perag(default): 9 +bulkstat 1 perag(v1): 9 +bulkstat 1 perag(v5): 9 +inumbers all(default): inumbers is in range +inumbers 71(default): inumbers is in range +inumbers 2(default): inumbers is in range +inumbers 1(default): inumbers is in range +inumbers all(v1): inumbers is in range +inumbers 71(v1): inumbers is in range +inumbers 2(v1): inumbers is in range +inumbers 1(v1): inumbers is in range +inumbers all(v5): inumbers is in range +inumbers 71(v5): inumbers is in range +inumbers 2(v5): inumbers is in range +inumbers 1(v5): inumbers is in range diff --git a/tests/xfs/745 b/tests/xfs/745 new file mode 100755 index 00000000..dcb14c41 --- /dev/null +++ b/tests/xfs/745 @@ -0,0 +1,47 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2019 Oracle, Inc. All Rights Reserved. +# +# FS QA Test No. 745 +# +# Regression test for a long-standing bug in BULKSTAT and INUMBERS where +# the kernel fails to write thew new @lastip value back to userspace if +# @ocount is NULL. +# +# This is a regression test for commit f16fe3ecde62 ("xfs: bulkstat should copy +# lastip whenever userspace supplies one") +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +_require_test_program "bulkstat_null_ocount" + +# real QA test starts here + +_supported_fs xfs +_supported_os Linux + +rm -f $seqres.full + +echo "Silence is golden." +src/bulkstat_null_ocount $TEST_DIR + +# success, all done +status=0 +exit diff --git a/tests/xfs/745.out b/tests/xfs/745.out new file mode 100644 index 00000000..ce947de2 --- /dev/null +++ b/tests/xfs/745.out @@ -0,0 +1,2 @@ +QA output created by 745 +Silence is golden. diff --git a/tests/xfs/group b/tests/xfs/group index 270d82ff..ef0cf92c 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -506,3 +506,5 @@ 506 auto quick health 507 clone 508 auto quick quota +744 auto ioctl quick +745 auto ioctl quick