From patchwork Fri Nov 23 05:59:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Rajendra X-Patchwork-Id: 10695047 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 236C75A4 for ; Fri, 23 Nov 2018 05:59:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06A8D2C53D for ; Fri, 23 Nov 2018 05:59:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEE462C543; Fri, 23 Nov 2018 05:59:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AE552C53D for ; Fri, 23 Nov 2018 05:59:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2501983AbeKWQmV (ORCPT ); Fri, 23 Nov 2018 11:42:21 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:35318 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729305AbeKWQmV (ORCPT ); Fri, 23 Nov 2018 11:42:21 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wAN5sOX9145539 for ; Fri, 23 Nov 2018 00:59:36 -0500 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0b-001b2d01.pphosted.com with ESMTP id 2nx73v1f08-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 23 Nov 2018 00:59:36 -0500 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 23 Nov 2018 05:59:35 -0000 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 23 Nov 2018 05:59:34 -0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wAN5xXbx16187508 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 23 Nov 2018 05:59:33 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9622FBE059; Fri, 23 Nov 2018 05:59:33 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F1837BE054; Fri, 23 Nov 2018 05:59:31 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.85.75.147]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 23 Nov 2018 05:59:31 +0000 (GMT) From: Chandan Rajendra To: fstests@vger.kernel.org Cc: Chandan Rajendra , guaneryu@gmail.com Subject: [PATCH 1/2] ext4/002: Work with 64k block size Date: Fri, 23 Nov 2018 11:29:29 +0530 X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18112305-0020-0000-0000-00000E8EEEF9 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010104; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000270; SDB=6.01121447; UDB=6.00582004; IPR=6.00901566; MB=3.00024288; MTD=3.00000008; XFM=3.00000015; UTC=2018-11-23 05:59:35 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18112305-0021-0000-0000-000063CF052D Message-Id: <20181123055930.21423-1-chandan@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-23_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 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-1810050000 definitions=main-1811230050 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This commit changes the script to operate on FS blocks by obtaining the block size from the underlying filesystem and using it to perform I/O in units of block sizes. This commit also uses $SCRATCH_MNT rather than $TEST_DIR for holding the test files since the FS on $TEST_DIR might be created with a different block size than the one specified in $MKFS_OPTIONS. Signed-off-by: Chandan Rajendra --- tests/ext4/002 | 68 ++++++++++++++++++++++++---------------------- tests/ext4/002.out | 18 ++++-------- 2 files changed, 41 insertions(+), 45 deletions(-) diff --git a/tests/ext4/002 b/tests/ext4/002 index c4fb3bde..b911b1a4 100755 --- a/tests/ext4/002 +++ b/tests/ext4/002 @@ -105,61 +105,63 @@ _check_ext4_eof_flag() _supported_fs ext4 _supported_os Linux _require_xfs_io_command "falloc" -_require_test +_require_scratch # Real QA test starts here. rm -f $seqres.full -# Remove any leftover files from last run. -rm -f ${TEST_DIR}/test_? +_scratch_mkfs >> $seqres.full 2>&1 +_scratch_mount + +BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT) # Begin test cases. -echo "Test 1: Fallocate 40960 bytes and write 4096 bytes (buffered io)." \ +echo "Test 1: Fallocate 10 blocks and write 1 block (buffered io)." \ >> $seqres.full -${XFS_IO_PROG} -f \ - -c 'falloc -k 0 40960' \ - -c 'pwrite 0 4096' \ - ${TEST_DIR}/test_1 | _filter_xfs_io_unique +${XFS_IO_PROG} -f \ + -c "falloc -k 0 $((10 * $BLOCK_SIZE))" \ + -c "pwrite 0 $BLOCK_SIZE" \ + ${SCRATCH_MNT}/test_1 | _filter_xfs_io_blocks_modified _check_ext4_eof_flag test_1 ${BIT_SET} -echo "Test 2: Fallocate 40960 bytes and write 4096 bytes (direct io)." \ +echo "Test 2: Fallocate 10 blocks and write 1 block (direct io)." \ >> $seqres.full -${XFS_IO_PROG} -f -d \ - -c 'falloc -k 0 40960' \ - -c 'pwrite 0 4096' \ - ${TEST_DIR}/test_2 | _filter_xfs_io_unique +${XFS_IO_PROG} -f -d \ + -c "falloc -k 0 $((10 * $BLOCK_SIZE))" \ + -c "pwrite 0 $BLOCK_SIZE" \ + ${SCRATCH_MNT}/test_2 | _filter_xfs_io_blocks_modified _check_ext4_eof_flag test_2 ${BIT_SET} -echo "Test 3: Fallocate 40960 bytes and write 40960 bytes (buffered io)." \ +echo "Test 3: Fallocate 10 blocks and write 10 blocks (buffered io)." \ >> $seqres.full -${XFS_IO_PROG} -f \ - -c 'falloc -k 0 40960' \ - -c 'pwrite 0 40960' \ - ${TEST_DIR}/test_3 | _filter_xfs_io_unique +${XFS_IO_PROG} -f \ + -c "falloc -k 0 $((10 * $BLOCK_SIZE))" \ + -c "pwrite 0 $((10 * $BLOCK_SIZE))" \ + ${SCRATCH_MNT}/test_3 | _filter_xfs_io_blocks_modified _check_ext4_eof_flag test_3 ${BIT_NOT_SET} -echo "Test 4: Fallocate 40960 bytes and write 40960 bytes (direct io)." \ +echo "Test 4: Fallocate 10 blocks and write 10 blocks (direct io)." \ >> $seqres.full -${XFS_IO_PROG} -f -d \ - -c 'falloc -k 0 40960' \ - -c 'pwrite 0 40960' \ - ${TEST_DIR}/test_4 | _filter_xfs_io_unique +${XFS_IO_PROG} -f -d \ + -c "falloc -k 0 $((10 * $BLOCK_SIZE))" \ + -c "pwrite 0 $((10 * $BLOCK_SIZE))" \ + ${SCRATCH_MNT}/test_4 | _filter_xfs_io_blocks_modified _check_ext4_eof_flag test_4 ${BIT_NOT_SET} -echo "Test 5: Fallocate 128k, seek 256k and write 4k block (buffered io)." \ +echo "Test 5: Fallocate 32 blocks, seek 64 blocks and write 1 block (buffered io)." \ >> $seqres.full -${XFS_IO_PROG} -f \ - -c 'falloc -k 0 128k' \ - -c 'pwrite 256k 4k' \ - ${TEST_DIR}/test_5 | _filter_xfs_io_unique +${XFS_IO_PROG} -f \ + -c "falloc -k 0 $((32 * $BLOCK_SIZE))" \ + -c "pwrite $((64 * $BLOCK_SIZE)) $BLOCK_SIZE" \ + ${SCRATCH_MNT}/test_5 | _filter_xfs_io_blocks_modified _check_ext4_eof_flag test_5 ${BIT_NOT_SET} -echo "Test 6: Fallocate 128k, seek to 256k and write a 4k block (direct io)." \ +echo "Test 6: Fallocate 32 blocks, seek to 64 blocks and write 1 block (direct io)." \ >> $seqres.full -${XFS_IO_PROG} -f -d \ - -c 'falloc -k 0 128k' \ - -c 'pwrite 256k 4k' \ - ${TEST_DIR}/test_6 | _filter_xfs_io_unique +${XFS_IO_PROG} -f -d \ + -c "falloc -k 0 $((32 * $BLOCK_SIZE))" \ + -c "pwrite $((64 * $BLOCK_SIZE)) $BLOCK_SIZE" \ + ${SCRATCH_MNT}/test_6 | _filter_xfs_io_blocks_modified _check_ext4_eof_flag test_6 ${BIT_NOT_SET} status=0 diff --git a/tests/ext4/002.out b/tests/ext4/002.out index 3dcca877..1605a115 100644 --- a/tests/ext4/002.out +++ b/tests/ext4/002.out @@ -1,13 +1,7 @@ QA output created by 002 -wrote 4096/4096 bytes at offset 0 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 4096/4096 bytes at offset 0 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 40960/40960 bytes at offset 0 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 40960/40960 bytes at offset 0 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 4096/4096 bytes at offset 262144 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 4096/4096 bytes at offset 262144 -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Blocks modified: [0 - 0] +Blocks modified: [0 - 0] +Blocks modified: [0 - 9] +Blocks modified: [0 - 9] +Blocks modified: [64 - 64] +Blocks modified: [64 - 64] From patchwork Fri Nov 23 05:59:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Rajendra X-Patchwork-Id: 10695051 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 E59675A4 for ; Fri, 23 Nov 2018 05:59:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3A9C2C53D for ; Fri, 23 Nov 2018 05:59:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7DBB2C543; Fri, 23 Nov 2018 05:59: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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 773902C53D for ; Fri, 23 Nov 2018 05:59:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2501987AbeKWQme (ORCPT ); Fri, 23 Nov 2018 11:42:34 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50372 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729305AbeKWQmd (ORCPT ); Fri, 23 Nov 2018 11:42:33 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wAN5sSpE101970 for ; Fri, 23 Nov 2018 00:59:49 -0500 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0a-001b2d01.pphosted.com with ESMTP id 2nx24t9x31-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 23 Nov 2018 00:59:48 -0500 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 23 Nov 2018 05:59:40 -0000 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 23 Nov 2018 05:59:37 -0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wAN5xauw8519858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 23 Nov 2018 05:59:36 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B3060BE04F; Fri, 23 Nov 2018 05:59:36 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5A58DBE053; Fri, 23 Nov 2018 05:59:35 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.85.75.147]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 23 Nov 2018 05:59:34 +0000 (GMT) From: Chandan Rajendra To: fstests@vger.kernel.org Cc: Chandan Rajendra , guaneryu@gmail.com Subject: [PATCH 2/2] ext4/021: Work with 64k block size Date: Fri, 23 Nov 2018 11:29:30 +0530 X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181123055930.21423-1-chandan@linux.vnet.ibm.com> References: <20181123055930.21423-1-chandan@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18112305-0020-0000-0000-00000E8EEEFA X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010104; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000270; SDB=6.01121447; UDB=6.00582004; IPR=6.00901566; MB=3.00024288; MTD=3.00000008; XFM=3.00000015; UTC=2018-11-23 05:59:38 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18112305-0021-0000-0000-000063CF052F Message-Id: <20181123055930.21423-2-chandan@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-23_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 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-1810050000 definitions=main-1811230050 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For 64k blocksize, 10MiB as the filesystem size isn't sufficient to have a journal included. Hence this commit computes the test FS size based on the block size of the underlying filesystem. Signed-off-by: Chandan Rajendra --- tests/ext4/021 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/ext4/021 b/tests/ext4/021 index 3d36efd0..519737e1 100755 --- a/tests/ext4/021 +++ b/tests/ext4/021 @@ -34,13 +34,16 @@ _supported_os Linux _require_scratch _require_dumpe2fs -# 10M in bytes -fssize=$((10 * 1024 * 1024)) +_scratch_mkfs >> $seqres.full 2>&1 +_scratch_mount +blocksize=$(_get_block_size $SCRATCH_MNT) +_scratch_unmount + +# With 4k block size, this amounts to 10M FS instance. +fssize=$((2560 * $blocksize)) _scratch_mkfs_sized $fssize >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV -blocksize=`$DUMPE2FS_PROG -h $SCRATCH_DEV 2>/dev/null | grep "Block size" | \ - awk '{print $3}'` offset=0 found=0 # this is the jbd2 journal superblock magic number on disk, in big endian