Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2798702rdb; Fri, 22 Sep 2023 08:39:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCcYLsxI/5JaBOkOisMdgDD/ciT6/oyBdK/07IJ/0L8QS5wGV5SkZ3reN7OqPONRhKzOhj X-Received: by 2002:a17:90a:9f8a:b0:26b:9e2:1298 with SMTP id o10-20020a17090a9f8a00b0026b09e21298mr65234pjp.11.1695397143752; Fri, 22 Sep 2023 08:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695397143; cv=none; d=google.com; s=arc-20160816; b=D3eJr+halLLrkx+FegKI5w8iIQjUI9LrPyKKSrzdd5f8kWx9xVZVkMmWz7rDHy2omj xHhwW4nfsFvRXJxv3h0xWrVTVSEMoPr2EI5jg6pk3ey6Os+k7KFEQPcjE4ghlC/yIv8W A7EvKDAkHa8rNTO6E88yil9SILOkq6Z827wyft2t9xZl3xH0BOmCFgOjCz/nvGxS0Kza JJ6gF+lLRQFLE6crZZABAgyMDDwGiCeYQebUzsh9tGsXF7M6QKmRaFJWpQV6mZCZzvCc r+Y+Z9RnQAmez0QuAfxFwpo6EXvrw/fZAHZIcJWFDiiPnbzoGVb3SK8g//9tmXEEVzcQ hp/g== 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:dkim-signature; bh=+vZ5ssLC1K6QF7PKpBfWB+39lVu12TOfShDTncFKfSQ=; fh=RrgFNaILOska2HTwr1tdxe2eTH1RwgQXf0Zc7TKC8sg=; b=ZHZe4dwXknXkvPePcw7cvVTrco4G1U1zdwWZPeggUO7liOsUfQdrK45xxKgizUnSSF PUlE4/B/lfGovbXKgixrnF295hdniZ/7USoEYWYcxzkZJhjMs+J7Fn17QkO5mTf5NQwa B+7GP5jnU2/X9+6Gr1kypGbAfc9/d6vKwW0IDbD6meAxySGAURjYTMqUB6ahny4IWPFR gCqdz2YNvqtlUtPmrddMhmRNQMj7QNVRc9Vst1Tdalrk/UMzUwhPhgnOCW/EqM1TPk0u O+59VYneC0q5980R3sSThg7iVovVNvA+cyTpSbm8wZWcaG7vYqdTnzd1hsDY056XcIY4 3/8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r9yDc3Bj; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id v10-20020a17090abb8a00b0026cf0b7e813si6001404pjr.94.2023.09.22.08.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 08:39:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r9yDc3Bj; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id D29DF83B5A02; Fri, 22 Sep 2023 08:21:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232494AbjIVPVY (ORCPT + 99 others); Fri, 22 Sep 2023 11:21:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232239AbjIVPVY (ORCPT ); Fri, 22 Sep 2023 11:21:24 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB3B2A1; Fri, 22 Sep 2023 08:21:17 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74D2DC433C7; Fri, 22 Sep 2023 15:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695396077; bh=ij9sQedXywv7LVfCQIvTYStG7bDNfL6PZxTLsZZzB1M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r9yDc3BjhRr/yu1b3PR4hPIdvru9iP2b+AJPBg0DxSEaKg4IMXinp529XotMQEgpk cBcnqjD+v+Z0CY+NLGppouJ/jJ8UjZl7Dqc+dFrspzdyp8QTxyuFT8RM15m+PvKGjx dIXt5Fn+CnB2Zr2IDjwAofuhzIjeFsokUMflvuLVM9VkwBbzjmCCuqV2aZIF4O9T0S 7igJCbPdOy/x4vmm/z79Taenl570xDtWtiAflgysq9toXoWPN8cT7fl0lEFoPwb6GA O3gVS+18WZDyPKLhSudxzGY5xLNxNm9+nZgVFNE5xg6tSEVBVrZJ0fZBa0XIwrMAn4 CLOpjBhEF+fHg== Date: Fri, 22 Sep 2023 08:21:16 -0700 From: "Darrick J. Wong" To: "Ritesh Harjani (IBM)" Cc: fstests@vger.kernel.org, linux-ext4@vger.kernel.org, Jan Kara , Theodore Ts'o , Gao Xiang Subject: Re: [PATCH] generic: Add integrity tests with synchronous directio Message-ID: <20230922152116.GA11380@frogsfrogsfrogs> References: <87y1gy5s9c.fsf@doe.com> <434beffaf18d39f898518ea9eb1cea4548e77c3a.1695383715.git.ritesh.list@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <434beffaf18d39f898518ea9eb1cea4548e77c3a.1695383715.git.ritesh.list@gmail.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 22 Sep 2023 08:21:33 -0700 (PDT) On Fri, Sep 22, 2023 at 05:40:36PM +0530, Ritesh Harjani (IBM) wrote: > This test covers data & metadata integrity check with directio with > o_sync flag and checks the file contents & size after sudden fileystem > shutdown once the directio write is completed. ext4 directio after iomap > conversion was broken in the sense that if the FS crashes after > synchronous directio write, it's file size is not properly updated. > This test adds a testcase to cover such scenario. > > Man page of open says that - > O_SYNC provides synchronized I/O file integrity completion, meaning write > operations will flush data and all associated metadata to the underlying > hardware > > Reported-by: Gao Xiang > Signed-off-by: Ritesh Harjani (IBM) > --- > tests/generic/471 | 45 +++++++++++++++++++++++++++++++++++++++++++ > tests/generic/471.out | 8 ++++++++ > 2 files changed, 53 insertions(+) > create mode 100755 tests/generic/471 > create mode 100644 tests/generic/471.out > > diff --git a/tests/generic/471 b/tests/generic/471 > new file mode 100755 > index 00000000..6c31cff8 > --- /dev/null > +++ b/tests/generic/471 > @@ -0,0 +1,45 @@ > +#! /bin/bash > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright (c) 2023 IBM Corporation. All Rights Reserved. > +# > +# FS QA Test 471 > +# > +# Integrity test with DIRECT_IO & O_SYNC with sudden shutdown > +# > +. ./common/preamble > +_begin_fstest auto quick shutdown > + > +# Override the default cleanup function. > +_cleanup() > +{ > + cd / > + rm -r -f $tmp.* > +} > + > +# Import common functions. > +. ./common/filter > + > +# real QA test starts here > + > +# Modify as appropriate. > +_supported_fs generic > +_require_scratch > +_require_scratch_shutdown > + > +_scratch_mkfs > $seqres.full 2>&1 > +_scratch_mount > + > +echo "Create a 1M file using O_DIRECT & O_SYNC" > +xfs_io -fsd -c "pwrite -S 0x5a 0 1M" $SCRATCH_MNT/testfile > /dev/null 2>&1 $XFS_IO_PROG ? Otherwise looks good to me... --D > + > +echo "Shutdown the fs suddenly" > +_scratch_shutdown > + > +echo "Cycle mount" > +_scratch_cycle_mount > + > +echo "File contents after cycle mount" > +_hexdump $SCRATCH_MNT/testfile > + > +status=0 > +exit > diff --git a/tests/generic/471.out b/tests/generic/471.out > new file mode 100644 > index 00000000..ae279b79 > --- /dev/null > +++ b/tests/generic/471.out > @@ -0,0 +1,8 @@ > +QA output created by 471 > +Create a 1M file using O_DIRECT & O_SYNC > +Shutdown the fs suddenly > +Cycle mount > +File contents after cycle mount > +000000 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a >ZZZZZZZZZZZZZZZZ< > +* > +100000 > -- > 2.41.0 >