Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2752133pxb; Sun, 3 Apr 2022 19:46:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxay/EMmQvMafY16Q51TaqQ+PvrO6dIgYA3zzHCRyEq7+pO3jbaTHpyEW3rGyIwNfmWB3i3 X-Received: by 2002:a65:5ac7:0:b0:399:28c:68d0 with SMTP id d7-20020a655ac7000000b00399028c68d0mr6349204pgt.254.1649040418739; Sun, 03 Apr 2022 19:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649040418; cv=none; d=google.com; s=arc-20160816; b=bITIGu5sr8Z6asBcpb8augsR8iraVlUYut5ox3PXHxg4bKXyDOKwk7k2JQk+U07pOS 57110cppTuIRPgmIbn2V4+nBwB4ulKR9D9SD2ZUSvj0MOyYIakC/ODHX66upteFfDEKD 8ge3IyyuDGQGHcf6/S6psXWIu6eGfd5Sl5lVKD79KxrRTJywalFEPYE3eBJnr1eVo+F4 n7iZlKTCi4xeL/YRjOtzCzM8muXK3Gxs/b+2BOhKt+upWu83tWv1Uu9G+NGDgJZyspAq eM3pwoVxUfa9Z7X/NHcUMQnwh+DYN8UyKPobNIMi/TBBvOyk7ey0Ho2bKkjXf/B/P6G4 aMHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=uRxo1+5mOiH1/XQaZQ6wphf1xPQI0ycg9+jvN5Brb60=; b=UbNaLwKoQ88s4Pqobu2diShHE5NTBMBoKYufoA3VPFQrVDaSgOtLsAlixcZgpCc/GZ YdkVt2T76aSSgttZPzmiOOd1M+d+alcj71vntLKL8Bj2S7VnjbtI7BBLmRWW3pqJH/uK Oi9X+fJJ+dnnJivayBdTjI7cKqS8cGSPNamo6ClWC1oJVmDR/xzu1dqN26pgEBzeC0QI UGSOJe0iXx934eUlHw6hs0TEMmC0J9BT47gCBkUqBa27uSsFWPKQC5OLXXjNaXgj+U/J uJLwCKj8m6KJXUf7qu2qblwFHZLR5RtJ2y/ODEF4kZadBhljVmM+S7/QDqaqZNGstKL8 YhFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 1-20020a630f41000000b003816043ee64si8247323pgp.89.2022.04.03.19.46.29; Sun, 03 Apr 2022 19:46:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376702AbiDCXpQ (ORCPT + 99 others); Sun, 3 Apr 2022 19:45:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376705AbiDCXpP (ORCPT ); Sun, 3 Apr 2022 19:45:15 -0400 Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 722462E9CC; Sun, 3 Apr 2022 16:43:20 -0700 (PDT) Received: from dread.disaster.area (pa49-180-43-123.pa.nsw.optusnet.com.au [49.180.43.123]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id A710653435A; Mon, 4 Apr 2022 09:43:19 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1nb9sM-00DSAi-2u; Mon, 04 Apr 2022 09:43:18 +1000 Date: Mon, 4 Apr 2022 09:43:18 +1000 From: Dave Chinner To: Ritesh Harjani Cc: fstests , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Darrick J . Wong" , Ritesh Harjani Subject: Re: [PATCHv3 4/4] generic/679: Add a test to check unwritten extents tracking Message-ID: <20220403234318.GU1609613@dread.disaster.area> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.4 cv=deDjYVbe c=1 sm=1 tr=0 ts=624a3117 a=MV6E7+DvwtTitA3W+3A2Lw==:117 a=MV6E7+DvwtTitA3W+3A2Lw==:17 a=kj9zAlcOel0A:10 a=z0gMJWrwH1QA:10 a=VnNF1IyMAAAA:8 a=7-415B0cAAAA:8 a=OHNP50dCb2NrX2JaUOMA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Mar 31, 2022 at 06:24:23PM +0530, Ritesh Harjani wrote: > From: Ritesh Harjani > > With these sequence of operation (in certain cases like with ext4 fast_commit) > could miss to track unwritten extents during replay phase > (after sudden FS shutdown). > > This fstest adds a test case to test this. > > 5e4d0eba1ccaf19f > ext4: fix fast commit may miss tracking range for FALLOC_FL_ZERO_RANGE > > Signed-off-by: Ritesh Harjani > --- > tests/generic/679 | 65 +++++++++++++++++++++++++++++++++++++++++++ > tests/generic/679.out | 6 ++++ > 2 files changed, 71 insertions(+) > create mode 100755 tests/generic/679 > create mode 100644 tests/generic/679.out > > diff --git a/tests/generic/679 b/tests/generic/679 > new file mode 100755 > index 00000000..4f35a9cd > --- /dev/null > +++ b/tests/generic/679 > @@ -0,0 +1,65 @@ > +#! /bin/bash > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright (c) 2022 IBM Corporation. All Rights Reserved. > +# > +# FS QA Test 679 > +# > +# Test below sequence of operation which (w/o below kernel patch) in case of > +# ext4 with fast_commit may misss to track unwritten extents. > +# commit 5e4d0eba1ccaf19f > +# ext4: fix fast commit may miss tracking range for FALLOC_FL_ZERO_RANGE > +# > +. ./common/preamble > +_begin_fstest auto quick log shutdown recoveryloop > + > +# Override the default cleanup function. > +_cleanup() > +{ > + cd / > + rm -r -f $tmp.* > +} Same as default. > + > +# Import common functions. > +. ./common/filter > +. ./common/punch > + > +# real QA test starts here > + > +# Modify as appropriate. > +_supported_fs generic > +_require_scratch > +_require_xfs_io_command "fzero" > +_require_xfs_io_command "fiemap" > +_require_scratch_shutdown > + > +t1=$SCRATCH_MNT/t1 > + > +_scratch_mkfs > $seqres.full 2>&1 > + > +_scratch_mount >> $seqres.full 2>&1 > + > +bs=$(_get_file_block_size $SCRATCH_MNT) > + > +# create and write data to t1 > +$XFS_IO_PROG -f -c "pwrite 0 $((100*$bs))" $t1 | _filter_xfs_io_numbers > + > +# fsync t1 > +$XFS_IO_PROG -c "fsync" $t1 > + > +# fzero certain range in between > +$XFS_IO_PROG -c "fzero -k $((40*$bs)) $((20*$bs))" $t1 > + > +# fsync t1 > +$XFS_IO_PROG -c "fsync" $t1 > + > +# shutdown FS now for replay of journal to kick during next mount > +_scratch_shutdown -v >> $seqres.full 2>&1 > + > +_scratch_cycle_mount > + > +# check fiemap reported is valid or not > +$XFS_IO_PROG -c "fiemap -v" $t1 | _filter_fiemap_flags $bs > + > +# success, all done > +status=0 > +exit > diff --git a/tests/generic/679.out b/tests/generic/679.out > new file mode 100644 > index 00000000..4d3c3377 > --- /dev/null > +++ b/tests/generic/679.out > @@ -0,0 +1,6 @@ > +QA output created by 679 > +wrote XXXX/XXXX bytes at offset XXXX > +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > +0: [0..39]: none > +1: [40..59]: unwritten > +2: [60..99]: nonelast This is a subset of the the previous test, and looks like it should be tested first before adding the second file and punch operation the previous test adds to this write/zero operations. IOWs, they look like they could easily be combined into a single test without losing anything except having an extra test that has to be run... Cheers, Dave. -- Dave Chinner david@fromorbit.com