From patchwork Tue Oct 27 19:01:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11861547 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77A1B14B4 for ; Tue, 27 Oct 2020 19:03:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 572B021556 for ; Tue, 27 Oct 2020 19:03:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="WiWrjn2x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829271AbgJ0TDj (ORCPT ); Tue, 27 Oct 2020 15:03:39 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:56900 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2444462AbgJ0TDj (ORCPT ); Tue, 27 Oct 2020 15:03:39 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RItCDi021959; Tue, 27 Oct 2020 19:03:38 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-2020-01-29; bh=B3qEeDKmVr51/Bd/pfeSVgNTeOSAfwZxTiAY/OSV6Xc=; b=WiWrjn2x9CBUK2BizzcvQU2uOSgETmfZZq3vRnOkVH5TPSaBzD5XBg8tnOXxdfsy1Kd3 qeepmf4hR9E7weo5osxdYRWaOLzBiCvZyAAByCV2rtAZ7hDA/CXOyRnnYMn/vDyAtEMe uB6/ym2kWurN7oIeC4D88vau5drZinqqr5ovVEjEM9lM4RWhQw1QpncesVA2v2VaiS8E 81COnCqfZ4tumhpxiXTk1xe47OXPxV3zbhhhaPb5UDKA5oDsdEQT+qatDz1BLzlyCxTg iefnsxJ69eNG3LzD6ffUuLAaDpMLWTJsLRJDaiB6TZ/MFaRp1TbINcfRN8NUyyf7cjsO jg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2130.oracle.com with ESMTP id 34c9sav0bk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Oct 2020 19:03:37 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIsRo3076905; Tue, 27 Oct 2020 19:01:37 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 34cwumrhcs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Oct 2020 19:01:37 +0000 Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 09RJ1b5I022896; Tue, 27 Oct 2020 19:01:37 GMT Received: from localhost (/10.159.243.144) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Oct 2020 12:01:36 -0700 Subject: [PATCH 1/9] common: extract rt extent size for _get_file_block_size From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 27 Oct 2020 12:01:35 -0700 Message-ID: <160382529579.1202316.931742119756545034.stgit@magnolia> In-Reply-To: <160382528936.1202316.2338876126552815991.stgit@magnolia> References: <160382528936.1202316.2338876126552815991.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 bulkscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 spamscore=0 phishscore=0 clxscore=1015 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong _get_file_block_size is intended to return the size (in bytes) of the fundamental allocation unit for a file. This is required for remapping operations like fallocate and reflink, which can only operate on allocation units. Since the XFS realtime volume can be configure for allocation units larger than 1 fs block, we need to factor that in here. Signed-off-by: Darrick J. Wong --- common/rc | 13 ++++++++++--- common/xfs | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/common/rc b/common/rc index 27a27ea3..41f93047 100644 --- a/common/rc +++ b/common/rc @@ -3974,11 +3974,18 @@ _get_file_block_size() echo "Missing mount point argument for _get_file_block_size" exit 1 fi - if [ "$FSTYP" = "ocfs2" ]; then + + case "$FSTYP" in + "ocfs2") stat -c '%o' $1 - else + ;; + "xfs") + _xfs_get_file_block_size $1 + ;; + *) _get_block_size $1 - fi + ;; + esac } # Get the minimum block size of an fs. diff --git a/common/xfs b/common/xfs index 79dab058..3f5c14ba 100644 --- a/common/xfs +++ b/common/xfs @@ -174,6 +174,26 @@ _scratch_mkfs_xfs() return $mkfs_status } +# Get the size of an allocation unit of a file. Normally this is just the +# block size of the file, but for realtime files, this is the realtime extent +# size. +_xfs_get_file_block_size() +{ + local path="$1" + + if ! ($XFS_IO_PROG -c "stat -v" "$path" 2>&1 | egrep -q '(rt-inherit|realtime)'); then + _get_block_size "$path" + return + fi + + # Otherwise, call xfs_info until we find a mount point or the root. + path="$(readlink -m "$path")" + while ! $XFS_INFO_PROG "$path" &>/dev/null && [ "$path" != "/" ]; do + path="$(dirname "$path")" + done + $XFS_INFO_PROG "$path" | grep realtime | sed -e 's/^.*extsz=\([0-9]*\).*$/\1/g' +} + # xfs_check script is planned to be deprecated. But, we want to # be able to invoke "xfs_check" behavior in xfstests in order to # maintain the current verification levels. From patchwork Tue Oct 27 19:01:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11861551 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5C56921 for ; Tue, 27 Oct 2020 19:03:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 97DFC21556 for ; Tue, 27 Oct 2020 19:03:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="wrXV5X2c" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829272AbgJ0TDq (ORCPT ); Tue, 27 Oct 2020 15:03:46 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:56996 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2444462AbgJ0TDq (ORCPT ); Tue, 27 Oct 2020 15:03:46 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RItNOJ022017; Tue, 27 Oct 2020 19:03: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-2020-01-29; bh=tCCbh4g/i0lM/N0oF6OVt3huFnrxDODn7jb+17KL0q4=; b=wrXV5X2cLmfjouQ1gMXVxwo3cDNBqf7qnePSB5OaheF4b91Cd5vWBAB92wHbaeRvlHC5 WOPik4e+b1fkHJ8zOLO6XA3c/LHuW5/IZhJKewSVl895rLXte6eVNKYZHuuahR6BKc3V X+TxSsYCUBwGlakh1F3FN/2SpsxJtyAUPUWg1T2fwxIJnP30sB04DDHyxx8Lvn0VX5vJ AWl13wEAO0KmL2JNqG1A4ISAS7zAgTkUgAljHjir86Bn79zIdxWAl+E8GuO7UpWFPAUR a0EM/GA+3cybKj4yY5hRaRHJTrEP902nlGbTJZYrrZKW2C/++y7sQj/YqLjnQcy6LpEV +w== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 34c9sav0c2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Oct 2020 19:03:44 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIu2bF133033; Tue, 27 Oct 2020 19:01:43 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 34cx5xg7kk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Oct 2020 19:01:43 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 09RJ1hE9023031; Tue, 27 Oct 2020 19:01:43 GMT Received: from localhost (/10.159.243.144) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Oct 2020 12:01:43 -0700 Subject: [PATCH 2/9] xfs/520: disable external devices From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 27 Oct 2020 12:01:42 -0700 Message-ID: <160382530205.1202316.9303713563959751852.stgit@magnolia> In-Reply-To: <160382528936.1202316.2338876126552815991.stgit@magnolia> References: <160382528936.1202316.2338876126552815991.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 spamscore=0 phishscore=0 clxscore=1015 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong This is a regression test for a specific bug that requires a specific configuration of the data device. Realtime volumes and external logs don't affect the efficacy of the test, but the test can fail mkfs if the realtime device is very large. Therefore, unset USE_EXTERNAL so that we always run this regression test, even if the tester enabled realtime. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- tests/xfs/520 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/xfs/520 b/tests/xfs/520 index 51bc4100..b99b9c6e 100755 --- a/tests/xfs/520 +++ b/tests/xfs/520 @@ -41,6 +41,9 @@ _disable_dmesg_check _require_check_dmesg _require_scratch_nocheck +# Don't let the rtbitmap fill up the data device and screw up this test +unset USE_EXTERNAL + force_crafted_metadata() { _scratch_mkfs_xfs -f $fsdsopt "$4" >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_xfs_set_metadata_field "$1" "$2" "$3" >> $seqres.full 2>&1 From patchwork Tue Oct 27 19:01:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11861467 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EDEF4921 for ; Tue, 27 Oct 2020 19:01:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9A06221FC for ; Tue, 27 Oct 2020 19:01:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="IuEgRxBI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2444463AbgJ0TB4 (ORCPT ); Tue, 27 Oct 2020 15:01:56 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:48326 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1829254AbgJ0TBz (ORCPT ); Tue, 27 Oct 2020 15:01:55 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIsVZC111581; Tue, 27 Oct 2020 19:01:52 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-2020-01-29; bh=t5UazSSz2wuYkLNo8xgTVj0d1ZP8hjcWEUpP1QXDbk8=; b=IuEgRxBIr4eQOcGxy9/rf/eWG+VPzfifbk7k3YaaufqLZpiYbKLKclmolFJtjm9TLjBg fAE7wJOXQhInRgSqNWwz0SrfHQdyqp7/TpKjj/XQspDkusjR+jq9B3SHksN/zZMtCcyx mIxvZpOeseZQO1tXSd42T35aTQpLMlPFhKXDBlCV2Ofeg0l6+KGt2Cvtysu1N4dVYDr4 alMk8z5LmqC/2uIkrL2ceI9ipdqPklAaAQedqUJmqAjXSEN+oK44U7KimMH78PrBAjia aj0NN26VtnmduwBJri1j+beF9Lwl+TUP0ZBtTyhNrhfPZkOerUQDv18QkbswuV3DWFEm Bg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 34dgm41exc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Oct 2020 19:01:52 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIu2DO133014; Tue, 27 Oct 2020 19:01:52 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 34cx5xg7rw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Oct 2020 19:01:51 +0000 Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09RJ1pXH005898; Tue, 27 Oct 2020 19:01:51 GMT Received: from localhost (/10.159.243.144) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Oct 2020 12:01:51 -0700 Subject: [PATCH 3/9] xfs/341: fix test when rextsize > 1 From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 27 Oct 2020 12:01:48 -0700 Message-ID: <160382530837.1202316.5888266175366678239.stgit@magnolia> In-Reply-To: <160382528936.1202316.2338876126552815991.stgit@magnolia> References: <160382528936.1202316.2338876126552815991.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 impostorscore=0 adultscore=0 bulkscore=0 spamscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 clxscore=1015 mlxscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Fix this test so that it works when the rt extent size is larger than single block. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- tests/xfs/341 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/xfs/341 b/tests/xfs/341 index 37ff2bd9..e1fbe588 100755 --- a/tests/xfs/341 +++ b/tests/xfs/341 @@ -41,6 +41,8 @@ cat $tmp.mkfs > "$seqres.full" 2>&1 _scratch_mount blksz="$(_get_block_size $SCRATCH_MNT)" +rtextsz_blks=$((rtextsz / blksz)) + # inode core size is at least 176 bytes; btree header is 56 bytes; # rtrmap record is 32 bytes; and rtrmap key/pointer are 56 bytes. i_ptrs=$(( (isize - 176) / 56 )) @@ -52,14 +54,14 @@ len=$((blocks * rtextsz)) echo "Create some files" $XFS_IO_PROG -f -R -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCRATCH_MNT/f1 >> $seqres.full $XFS_IO_PROG -f -R -c "falloc 0 $len" -c "pwrite -S 0x68 -b 1048576 0 $len" $SCRATCH_MNT/f2 >> $seqres.full -$here/src/punch-alternating $SCRATCH_MNT/f1 >> "$seqres.full" -$here/src/punch-alternating $SCRATCH_MNT/f2 >> "$seqres.full" +$here/src/punch-alternating -i $((2 * rtextsz_blks)) -s $rtextsz_blks $SCRATCH_MNT/f1 >> "$seqres.full" +$here/src/punch-alternating -i $((2 * rtextsz_blks)) -s $rtextsz_blks $SCRATCH_MNT/f2 >> "$seqres.full" echo garbage > $SCRATCH_MNT/f3 ino=$(stat -c '%i' $SCRATCH_MNT/f3) _scratch_unmount echo "Corrupt fs" -fsbno=$(_scratch_xfs_db -c "inode $ino" -c 'bmap' | \ +fsbno=$(_scratch_xfs_db -c "inode $ino" -c 'bmap' | grep 'flag 0' | head -n 1 | \ sed -e 's/^.*startblock \([0-9]*\) .*$/\1/g') _scratch_xfs_db -x -c 'sb 0' -c 'addr rrmapino' \ From patchwork Tue Oct 27 19:01:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11861469 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 16E7914B4 for ; Tue, 27 Oct 2020 19:02:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA9B121D42 for ; Tue, 27 Oct 2020 19:02:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="fHntdvme" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829254AbgJ0TCB (ORCPT ); Tue, 27 Oct 2020 15:02:01 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:48428 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2444475AbgJ0TCB (ORCPT ); Tue, 27 Oct 2020 15:02:01 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIsV2U111568; Tue, 27 Oct 2020 19:01:58 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-2020-01-29; bh=/YYcOW+Lb/GRpy+3vvv4+svPN4X7l+u+PV2Ty1GVohE=; b=fHntdvmeVrB8UkyZ2WlP4juQmcwqSakYfoqjF4GAuB6hUUZgGapIT+YQ7WMWMjJ0qrh5 iqc9oOup2Qhoq/R2jhQFhr7G1RLBvFmzi3GaOYzxRVGTSNVUZHfeKEBz5cYKnoIgeQTm 9lmYlq95ujCt1nHpMaLHXCG50qnuObGIHDykKKB4TIAq36yhgIsTT/4Gz/1uknuw4Y0R sg3Rbt4i/SpmO2jEbid/x/zjugiZfIPg2/ov7A5XyM6h0MVNOPcxQgUboAsEtvQuVjzT G2mwu4FEZ0oJbjTjeBxChhUygCz4Xu90DFM/EguFYd6keilaWI0hvxELk0kilMVv/wg6 gA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 34dgm41exq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Oct 2020 19:01:58 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RItKEw019910; Tue, 27 Oct 2020 19:01:58 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 34cx6wbm6g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Oct 2020 19:01:58 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09RJ1vpf000943; Tue, 27 Oct 2020 19:01:57 GMT Received: from localhost (/10.159.243.144) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Oct 2020 12:01:57 -0700 Subject: [PATCH 4/9] various: replace _get_block_size with _get_file_block_size when needed From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 27 Oct 2020 12:01:56 -0700 Message-ID: <160382531634.1202316.310897007206501013.stgit@magnolia> In-Reply-To: <160382528936.1202316.2338876126552815991.stgit@magnolia> References: <160382528936.1202316.2338876126552815991.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 suspectscore=2 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 impostorscore=0 adultscore=0 bulkscore=0 spamscore=0 phishscore=0 mlxlogscore=999 suspectscore=2 clxscore=1015 mlxscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong The _get_file_block_size helper was added so that tests could find out the size of a fundamental unit of allocation for a given file, which is necessary for certain fallocate and clonerange tests. On certain filesystem configurations (ocfs2 with clusters, xfs with a large rt extent size), this is /not/ the same as the filesystem block size, and these tests will fail. Fix them to use the correct helper. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- tests/xfs/328 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/xfs/328 b/tests/xfs/328 index 9b17b6a4..26325b40 100755 --- a/tests/xfs/328 +++ b/tests/xfs/328 @@ -48,7 +48,7 @@ mkdir "$testdir" # 2^10 blocks... that should be plenty for anyone. fnr=$((12 + LOAD_FACTOR)) free_blocks=$(stat -f -c '%a' "$testdir") -blksz=$(_get_block_size $testdir) +blksz=$(_get_file_block_size $testdir) space_avail=$((free_blocks * blksz)) calc_space() { From patchwork Tue Oct 27 19:02:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11861563 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5F1D814B4 for ; Tue, 27 Oct 2020 19:04:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AC7721556 for ; Tue, 27 Oct 2020 19:04:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="pSFb3jvk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1829281AbgJ0TEG (ORCPT ); Tue, 27 Oct 2020 15:04:06 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:57278 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2444462AbgJ0TEG (ORCPT ); Tue, 27 Oct 2020 15:04:06 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RItCvp021945; Tue, 27 Oct 2020 19:04:04 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-2020-01-29; bh=FcgvApeAFi2x+2hlgEZnzGcD/mrEAiH5VemFqtAvZNA=; b=pSFb3jvkPbiHb+LhicQIt+y/SABU6alx7vlwAWNWworZlRawH3a6T9s/oXYNPxQgKUW8 2deFTGGWni8t4CyQl+QEiGhiNYBHd0VYrFYTfciKbkf3JEfvP80eUsT9ndVokpJ9h047 WgTLKGYwhnpFT41U2z9cQa4uC6LoU3qWSfWITMjqsT7zlVFJnQgHYwcvPH7q282NQlBV FzlbmzybPBf3p1YawVoVfWkOVWJmEmZZqPI+8nir52Rd+KASzN58uG6k6aROVKytf3f4 mIDiOu8W6q38a8QAPLpfMkelgT6lQBCuWQ+CITcFpjL/CQUAvtP7HPv514ELvq6bz6tz Hw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2130.oracle.com with ESMTP id 34c9sav0dn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Oct 2020 19:04:04 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIsPA0076525; Tue, 27 Oct 2020 19:02:04 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 34cwumrhsv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Oct 2020 19:02:04 +0000 Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 09RJ23pr023269; Tue, 27 Oct 2020 19:02:03 GMT Received: from localhost (/10.159.243.144) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Oct 2020 12:02:03 -0700 Subject: [PATCH 5/9] xfs/327: fix inode reflink flag checking From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 27 Oct 2020 12:02:02 -0700 Message-ID: <160382532250.1202316.4733915561999380155.stgit@magnolia> In-Reply-To: <160382528936.1202316.2338876126552815991.stgit@magnolia> References: <160382528936.1202316.2338876126552815991.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 bulkscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 spamscore=0 phishscore=0 clxscore=1015 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong This is a regression test that tried to make sure that repair correctly clears the XFS inode reflink flag when it detects files that do not share any blocks. However, it does this checking by looking at the (online) lsattr output. This worked fine during development when we exposed the reflink state via the stat ioctls, but that has long since been removed. Now the only way to check is via xfs_db, so switch it to use that. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- tests/xfs/327 | 18 ++++++++++++++++-- tests/xfs/327.out | 13 +++++++------ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/tests/xfs/327 b/tests/xfs/327 index 017e2a84..7a14798f 100755 --- a/tests/xfs/327 +++ b/tests/xfs/327 @@ -49,10 +49,21 @@ seq 1 $nr | while read i; do done sync +ino_0=$(stat -c '%i' $SCRATCH_MNT/file.0) +ino_64=$(stat -c '%i' $SCRATCH_MNT/file.64) +ino_128=$(stat -c '%i' $SCRATCH_MNT/file.128) + +echo "Check filesystem" +_scratch_unmount +_scratch_xfs_db -c "inode $ino_0" -c print \ + -c "inode $ino_64" -c print \ + -c "inode $ino_128" -c print | grep reflink | sed -e 's/^v[0-9]*/vX/g' +_scratch_mount + echo "Check files" for i in 0 $((nr / 2)) $nr; do md5sum $SCRATCH_MNT/file.$i | _filter_scratch - $XFS_IO_PROG -c 'lsattr -v' $SCRATCH_MNT/file.$i | _filter_scratch + $XFS_IO_PROG -c 'lsattr -v' $SCRATCH_MNT/file.$i >> $seqres.full done echo "CoW all files" @@ -63,12 +74,15 @@ done echo "Repair filesystem" _scratch_unmount _repair_scratch_fs >> $seqres.full +_scratch_xfs_db -c "inode $ino_0" -c print \ + -c "inode $ino_64" -c print \ + -c "inode $ino_128" -c print | grep reflink | sed -e 's/^v[0-9]*/vX/g' _scratch_mount echo "Check files again" for i in 0 $((nr / 2)) $nr; do md5sum $SCRATCH_MNT/file.$i | _filter_scratch - $XFS_IO_PROG -c 'lsattr -v' $SCRATCH_MNT/file.$i | _filter_scratch + $XFS_IO_PROG -c 'lsattr -v' $SCRATCH_MNT/file.$i >> $seqres.full done echo "Done" diff --git a/tests/xfs/327.out b/tests/xfs/327.out index 5b3cba21..0e204205 100644 --- a/tests/xfs/327.out +++ b/tests/xfs/327.out @@ -1,20 +1,21 @@ QA output created by 327 Format filesystem Create files +Check filesystem +vX.reflink = 1 +vX.reflink = 1 +vX.reflink = 1 Check files 8fa14cdd754f91cc6554c9e71929cce7 SCRATCH_MNT/file.0 -[] SCRATCH_MNT/file.0 8fa14cdd754f91cc6554c9e71929cce7 SCRATCH_MNT/file.64 -[] SCRATCH_MNT/file.64 8fa14cdd754f91cc6554c9e71929cce7 SCRATCH_MNT/file.128 -[] SCRATCH_MNT/file.128 CoW all files Repair filesystem +vX.reflink = 0 +vX.reflink = 0 +vX.reflink = 0 Check files again 8fa14cdd754f91cc6554c9e71929cce7 SCRATCH_MNT/file.0 -[] SCRATCH_MNT/file.0 0f17fd72b7bbf5bda0ff433e6d1fc118 SCRATCH_MNT/file.64 -[] SCRATCH_MNT/file.64 0f17fd72b7bbf5bda0ff433e6d1fc118 SCRATCH_MNT/file.128 -[] SCRATCH_MNT/file.128 Done From patchwork Tue Oct 27 19:02:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11861475 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C357414B7 for ; Tue, 27 Oct 2020 19:02:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A8BC221D42 for ; Tue, 27 Oct 2020 19:02:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="uOnTliej" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2444411AbgJ0TCO (ORCPT ); Tue, 27 Oct 2020 15:02:14 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:48566 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2410146AbgJ0TCN (ORCPT ); Tue, 27 Oct 2020 15:02:13 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIsV3R111549; Tue, 27 Oct 2020 19:02:11 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-2020-01-29; bh=HFSJOxpdSK3VULYP+EBTOaRwcAJPvxYcslqGRwY1J08=; b=uOnTliejaet6E9ttuk5mTWHbiiVQBE0Qg9WC6TDL6qF/7mgLjP6OUL3jmh1g+/TMEhgA onNkHrXjX19HNkzKqkwQjz3mQLP/RPo++bi3cVeILj66qJzNdKKP5uEHO+pgMoZORF16 k61YXQZ6uP+fM0JEgOoiDfBJs1kD+kRqrq6LVcGfg/cUgTwDNhKek4jXPtS40gtU7oqt TTk2fbsDYxqEHhs12cy/1Amp+9gZ9GK+Fq1FzWjCB0jhtGnnrZ0Kd8PntrbjJvbC1D93 vB0bhJj0bUKGWqxscDKM2Od1FGXHc84c6I+K9wiKFKBdm2pvw6H1Wi+MGlJUw8okVQKM Lw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 34dgm41eyp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Oct 2020 19:02:11 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RItLZL020077; Tue, 27 Oct 2020 19:02:10 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 34cx6wbmdy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Oct 2020 19:02:10 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09RJ2ADI001084; Tue, 27 Oct 2020 19:02:10 GMT Received: from localhost (/10.159.243.144) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Oct 2020 12:02:09 -0700 Subject: [PATCH 6/9] xfs/27[26]: force realtime on or off as needed From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 27 Oct 2020 12:02:08 -0700 Message-ID: <160382532889.1202316.11271089772377137054.stgit@magnolia> In-Reply-To: <160382528936.1202316.2338876126552815991.stgit@magnolia> References: <160382528936.1202316.2338876126552815991.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 impostorscore=0 adultscore=0 bulkscore=0 spamscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 clxscore=1015 mlxscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Certain tests have certain requirements where the realtime parameters are concerned. Fix them all. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- tests/xfs/272 | 3 +++ tests/xfs/276 | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/xfs/272 b/tests/xfs/272 index a9baf2e7..6c0fede5 100755 --- a/tests/xfs/272 +++ b/tests/xfs/272 @@ -37,6 +37,9 @@ echo "Format and mount" _scratch_mkfs > "$seqres.full" 2>&1 _scratch_mount +# Make sure everything is on the data device +$XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT + _pwrite_byte 0x80 0 737373 $SCRATCH_MNT/urk >> $seqres.full sync $here/src/punch-alternating $SCRATCH_MNT/urk >> $seqres.full diff --git a/tests/xfs/276 b/tests/xfs/276 index 8b7e1de5..6e2b2fb4 100755 --- a/tests/xfs/276 +++ b/tests/xfs/276 @@ -35,9 +35,15 @@ _require_test_program "punch-alternating" rm -f "$seqres.full" echo "Format and mount" -_scratch_mkfs > "$seqres.full" 2>&1 +_scratch_mkfs | _filter_mkfs 2> "$tmp.mkfs" +. $tmp.mkfs +cat "$tmp.mkfs" > $seqres.full _scratch_mount +# Don't let the rt extent size perturb the fsmap output with unwritten +# extents in places we don't expect them +test $rtextsz -eq $dbsize || _notrun "Skipping test due to rtextsize > 1 fsb" + $XFS_IO_PROG -f -R -c 'pwrite -S 0x80 0 737373' $SCRATCH_MNT/urk >> $seqres.full sync $here/src/punch-alternating $SCRATCH_MNT/urk >> $seqres.full From patchwork Tue Oct 27 19:02:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11861479 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 45950921 for ; Tue, 27 Oct 2020 19:02:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A89021556 for ; Tue, 27 Oct 2020 19:02:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="P6Wbh/FD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2444542AbgJ0TCU (ORCPT ); Tue, 27 Oct 2020 15:02:20 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:46154 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2410146AbgJ0TCU (ORCPT ); Tue, 27 Oct 2020 15:02:20 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIt3Yf108039; Tue, 27 Oct 2020 19:02:18 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-2020-01-29; bh=tTDd1rLWZY7euiQu4y0gxwc0ULrd9rOjVu7TkA1ceJI=; b=P6Wbh/FDSFBTe2tFetEieXLoKQw1P6rzNSNk+zZjAg1TYAx3XsdKjZI5ZBNtxAEQz0uF CgWzAO1Im4vqIDdL3oV3Sgo3/tw1UCvl2yDdtghdV35KFTAq+1GJBnVQ5uJjCpVqSLHV Im8NbICjX5ac3aDTe3SSYcQ4xfk4iAShh0vmmKPjVFPquHrGOOuAlECDolngQ8DbsmI8 qctgFv+fPL7deYxZ/WtCoav5/TWKi3BoMsHT6Jjlr/j5Z5A0V2w0koHmOVAjDOOayvlv uN/rfHlG4KMLDJHpZwAY36jLIYTnwPhY81sYNakHe/qqkFMv2ro1mQvHdI2FoWgAVnlu kg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 34cc7kuurj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Oct 2020 19:02:17 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIu2V2132924; Tue, 27 Oct 2020 19:02:17 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 34cx5xg85v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Oct 2020 19:02:17 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09RJ2G6e001115; Tue, 27 Oct 2020 19:02:16 GMT Received: from localhost (/10.159.243.144) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Oct 2020 12:02:15 -0700 Subject: [PATCH 7/9] xfs/030: hide the btree levels check errors From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 27 Oct 2020 12:02:15 -0700 Message-ID: <160382533506.1202316.2655281450906651514.stgit@magnolia> In-Reply-To: <160382528936.1202316.2338876126552815991.stgit@magnolia> References: <160382528936.1202316.2338876126552815991.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 mlxlogscore=999 suspectscore=2 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 adultscore=0 malwarescore=0 spamscore=0 clxscore=1015 mlxscore=0 suspectscore=2 priorityscore=1501 impostorscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Newer versions of xfsprogs now complain if the rmap and refcount btree levels are insane, so hide that error from the golden output. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- common/repair | 1 + tests/xfs/030 | 1 + 2 files changed, 2 insertions(+) diff --git a/common/repair b/common/repair index 6668dd51..0ae7464e 100644 --- a/common/repair +++ b/common/repair @@ -45,6 +45,7 @@ s/(bad length -{0,1}\d+ for ag. 0, should be) (\d+)/\1 LENGTH/; s/(bad length # -{0,1}\d+ for ag. 0, should be) (\d+)/\1 LENGTH/; s/(bad agbno) (\d+)/\1 AGBNO/g; s/(max =) (\d+)/\1 MAX/g; +s/(bad levels) (\d+) (for [a-z]* root, agno) (\d+)/\1 LEVELS \3 AGNO/; # for root inos s/(on inode) (\d+)/\1 INO/g; s/(imap claims a free inode) (\d+)/\1 INO/; diff --git a/tests/xfs/030 b/tests/xfs/030 index b6590913..04440f9c 100755 --- a/tests/xfs/030 +++ b/tests/xfs/030 @@ -45,6 +45,7 @@ _check_ag() -e '/^agf has bad CRC/d' \ -e '/^agi has bad CRC/d' \ -e '/^Missing reverse-mapping record.*/d' \ + -e '/^bad levels LEVELS for [a-z]* root.*/d' \ -e '/^unknown block state, ag AGNO, block.*/d' done } From patchwork Tue Oct 27 19:02:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11861507 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 15534921 for ; Tue, 27 Oct 2020 19:02:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E63C8206F7 for ; Tue, 27 Oct 2020 19:02:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="r0qMllIr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2444573AbgJ0TCZ (ORCPT ); Tue, 27 Oct 2020 15:02:25 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:55806 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2410146AbgJ0TCZ (ORCPT ); Tue, 27 Oct 2020 15:02:25 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RItFxp021979; Tue, 27 Oct 2020 19:02:23 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-2020-01-29; bh=1uN6tgkxmEJ5UX6qSGjTRGy8/W3t2gP27dkRxZp6kZU=; b=r0qMllIr+nWq/+AldiCVV3+tDNG1aaJuOp6uZGvF0yjU9XnYtrW/J9w+O7OfNaw5jQvs UDZxT5r7APKI2lEPZDODtQfihZl6kilvPVYhqZuVw6zlDBpOB6zkVwyEukCZTsiHMm/5 2aW1IjmOo/h+Rer+U7anzrDD6C6CUz7E3Nc68eJHyKBbtkqL9fuxbxeJrT4Jq+86Uppd smmsKuLxXYt1O+/NZbzwL5QSTrMGL3b+RtLth0RE4SRu+J9abaZ/de+uqCRZITFH8ldC RX6syflszVwP7hd3YhUh5ATCOZJpYrb1FKSRj+JhmrmQuIoGhaIavKFwojM/uehXdHIn 2g== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 34c9sav05t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Oct 2020 19:02:23 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIu2Pg132992; Tue, 27 Oct 2020 19:02:22 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 34cx5xg882-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Oct 2020 19:02:22 +0000 Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09RJ2M29006155; Tue, 27 Oct 2020 19:02:22 GMT Received: from localhost (/10.159.243.144) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Oct 2020 12:02:22 -0700 Subject: [PATCH 8/9] check: run tests in a systemd scope for mandatory test cleanup From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 27 Oct 2020 12:02:21 -0700 Message-ID: <160382534122.1202316.7161591166906029132.stgit@magnolia> In-Reply-To: <160382528936.1202316.2338876126552815991.stgit@magnolia> References: <160382528936.1202316.2338876126552815991.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 spamscore=0 phishscore=0 clxscore=1015 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong If systemd is available, run each test in its own temporary systemd scope. This enables the test harness to forcibly clean up all of the test's child processes (if it does not do so itself) so that we can move into the post-test unmount and check cleanly. Signed-off-by: Darrick J. Wong --- check | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/check b/check index 5072dd82..47c72fa2 100755 --- a/check +++ b/check @@ -521,6 +521,11 @@ _expunge_test() return 0 } +# Can we run systemd scopes? +HAVE_SYSTEMD_SCOPES= +systemd-run --quiet --unit "fstests-check" --scope bash -c "exit 77" &> /dev/null +test $? -eq 77 && HAVE_SYSTEMD_SCOPES=yes + # Make the check script unattractive to the OOM killer... OOM_SCORE_ADJ="/proc/self/oom_score_adj" test -w ${OOM_SCORE_ADJ} && echo -1000 > ${OOM_SCORE_ADJ} @@ -528,8 +533,22 @@ test -w ${OOM_SCORE_ADJ} && echo -1000 > ${OOM_SCORE_ADJ} # ...and make the tests themselves somewhat more attractive to it, so that if # the system runs out of memory it'll be the test that gets killed and not the # test framework. +# +# If systemd is available, run the entire test script in a scope so that we can +# kill all subprocesses of the test if it fails to clean up after itself. This +# is essential for ensuring that the post-test unmount succeeds. _run_seq() { - bash -c "test -w ${OOM_SCORE_ADJ} && echo 250 > ${OOM_SCORE_ADJ}; exec ./$seq" + local cmd=(bash -c "test -w ${OOM_SCORE_ADJ} && echo 250 > ${OOM_SCORE_ADJ}; exec ./$seq") + + if [ -n "${HAVE_SYSTEMD_SCOPES}" ]; then + local unit="$(systemd-escape "fs$seq").scope" + systemd-run --quiet --unit "${unit}" --scope "${cmd[@]}" + res=$? + systemctl stop "${unit}" &> /dev/null + return "${res}" + else + "${cmd[@]}" + fi } _detect_kmemleak From patchwork Tue Oct 27 19:02:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11861511 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5E5514B4 for ; Tue, 27 Oct 2020 19:02:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9450E206DD for ; Tue, 27 Oct 2020 19:02:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="k6Pr/LBF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2444582AbgJ0TCd (ORCPT ); Tue, 27 Oct 2020 15:02:33 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:55898 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2410146AbgJ0TCc (ORCPT ); Tue, 27 Oct 2020 15:02:32 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RItXO4022089; Tue, 27 Oct 2020 19:02:30 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-2020-01-29; bh=BWEJZAdbHuzmGHpCdp0K1nbgZ+Zl3a8MnBf5mulTQsg=; b=k6Pr/LBFazGIGZjaB3G7rwO5uKhzLI4uCCUKRFdtT/baR/Ljy0whYmRE7V5CYyjZW4rs CJleFvEbvkK7XLu/ny+nT2QaD1evUoRjBcHu1aV0S2O2i3phkGiu13WUsY5RwfOGWm67 g2uH3mGQfKOICHVziKBKo/PZA1Z0DYNrj/ZHvoghMyBUJrTaB6nbOrRtk3DRt1qxJLvc Aw/A6KyCAprz3kjEL8TE2JwBSN0oxJSu8fQB84sSHd7exy91ueWjW66UuMOynHDRo7a3 gasPejPctUCIbcBT/WZsqOkAW9MknJizik6dY0ayOYZyqSSWWVQTvr5WLLCwfxvGTDFX Sw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 34c9sav066-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Oct 2020 19:02:30 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09RIu24m133026; Tue, 27 Oct 2020 19:02:29 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 34cx5xg8ae-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Oct 2020 19:02:29 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 09RJ2SE1027470; Tue, 27 Oct 2020 19:02:28 GMT Received: from localhost (/10.159.243.144) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Oct 2020 12:02:28 -0700 Subject: [PATCH 9/9] common/populate: make sure _scratch_xfs_populate puts its files on the data device From: "Darrick J. Wong" To: darrick.wong@oracle.com, guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 27 Oct 2020 12:02:27 -0700 Message-ID: <160382534741.1202316.10109027018039105023.stgit@magnolia> In-Reply-To: <160382528936.1202316.2338876126552815991.stgit@magnolia> References: <160382528936.1202316.2338876126552815991.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9787 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 spamscore=0 phishscore=0 clxscore=1015 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010270110 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org From: Darrick J. Wong Make sure that _scratch_xfs_populate always installs its files on the data device even if the test config selects rt by default. Signed-off-by: Darrick J. Wong --- common/populate | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/populate b/common/populate index 0b036051..75e6f499 100644 --- a/common/populate +++ b/common/populate @@ -154,6 +154,10 @@ _scratch_xfs_populate() { _populate_xfs_qmount_option _scratch_mount + + # Make sure the new files always end up on the data device + $XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT + blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")" dblksz="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep naming.*bsize | sed -e 's/^.*bsize=//g' -e 's/\([0-9]*\).*$/\1/g')" crc="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep crc= | sed -e 's/^.*crc=//g' -e 's/\([0-9]*\).*$/\1/g')" @@ -306,6 +310,7 @@ _scratch_xfs_populate() { if [ $is_rmapbt -gt 0 ] && [ $is_rt -gt 0 ]; then echo "+ rtrmapbt btree" nr="$((blksz * 2 / 32))" + $XFS_IO_PROG -R -f -c 'truncate 0' "${SCRATCH_MNT}/RTRMAPBT" __populate_create_file $((blksz * nr)) "${SCRATCH_MNT}/RTRMAPBT" fi