Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2903453rdb; Fri, 22 Sep 2023 11:29:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGcVLAwH8Rw8TbgACobPare3mxvshw46Q3RcQOHVKHeUyZNyvSsetcn9RPs+XpnanjxACM X-Received: by 2002:a05:6a00:2283:b0:690:d5d5:8d24 with SMTP id f3-20020a056a00228300b00690d5d58d24mr266404pfe.20.1695407366035; Fri, 22 Sep 2023 11:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695407366; cv=none; d=google.com; s=arc-20160816; b=qmUK7++gVshIwEsTP8mhphHoKpV4qu3ZMu5/I48cH9kAnZbpFlxZn13h0HVyr3tb5D XRwl8c4SmVTzBpanuF+4zRDbA9OU3iyzcG0QQ5yjz7AF5bz0mD/Z9hUruA7Pbru+0hax s1K1H3kAtTVktMhPAzLTupvVrFh3C/2j4+0QxIaNytVBZVKOuMS/SIxz4qU9w2KzL+r5 LwrWuFTC0lw4waWeswRhBCq/GRpaAyr7H5EwNAc+VFco6H0I/r6KZ0MxtqwOQvnMUedz 2idTVx8grvFC0sphIBIuHsRKo5AK5S9N2Cw+JEW+nwrCZMDFwi3RZIqQk1PDhb8POjsm 3pAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:subject:cc:to:from:message-id:date :dkim-signature; bh=7Tjf5r00Lqmhy/M6RVpzSsAVMaDILHAuySZ81BrNfgM=; fh=JS1ICMX6KLbSVDxuCPEj58NIjXGDKb4BtYlhFUEHdQ0=; b=Oke94w7B/uC6JBc/besynolF8fCLCm/ZbUr1BODVuMuO7rv2FmN72+ZWcfTPP6B64s Xw9ziwcG6uKniB/kEgqTHHXzeyAqutj43Yd8wg3IBemooszlUfHVnDKZzTp5xeTSOBqY AYyu2rsfej059EgAjPbXZ+pZ8cjPohy9CZrIB7aNFz6aDnzzcB2UKTKWhVyhIHXj17jX W+dADzIalmfLcPc+pk02gSipCZnzvuNdpcuM4BC0WdF0Hfl9hc++J+V3jKAjVf0SFr/F 3rO9Q2A1mkN/wFYBfnDjJK1JWO1fH6AZ3PJIkogpK2czPYiodVv7vdtcqXlx+VjX1c0m +Gdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="V/GnEe3B"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id a2-20020a056a000c8200b0064f78c32b89si4604246pfv.95.2023.09.22.11.29.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 11:29:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="V/GnEe3B"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 58A29837A4D0; Fri, 22 Sep 2023 09:13:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229534AbjIVQNX (ORCPT + 99 others); Fri, 22 Sep 2023 12:13:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231604AbjIVQNW (ORCPT ); Fri, 22 Sep 2023 12:13:22 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E6BA100; Fri, 22 Sep 2023 09:13:16 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1bdf4752c3cso18667925ad.2; Fri, 22 Sep 2023 09:13:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695399195; x=1696003995; darn=vger.kernel.org; h=in-reply-to:subject:cc:to:from:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=7Tjf5r00Lqmhy/M6RVpzSsAVMaDILHAuySZ81BrNfgM=; b=V/GnEe3BvuRtCNWZcFYYeE+r3ZLvSJWgghqAZtq86XdoX7gxlQQY0mdUu9RXTnbjLB zoldjABnYzaPSbK7HwA83DKmIoNhB+/i6ccA7JT+8JV4Of22zu4QhiwriUtCXiJmvjgd 1bV5I84jg43I+hcxlvHqV3GXm0p5CcAFSfx6njNXUQIqurzi2VyYNp+CjpWXuqhjJjNp L0x22nFnO0/yRD/PQ5HJANyyi58v0keS2VBIVek9Nj285LUek2kR0hqAOr+DB06Pi68+ SgdLu5cBQL9MH38nkyMbz+uChwPb5dW1KZqKbhp4arFR/ktxJuY/4tm/JMY2BqKPMsE6 rzDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695399195; x=1696003995; h=in-reply-to:subject:cc:to:from:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7Tjf5r00Lqmhy/M6RVpzSsAVMaDILHAuySZ81BrNfgM=; b=A1HIMeCbgOAF+r1gSgwv1Ip70SVca9sPjYB0H7ToO7G1gNVRGiapWhQVjInOkcwpxK Xmft0j973Ge3+PmcngkfqCPQGfQCYvpVSbqgZZVMEFLsv89YJr8aIxdKFCuuqBAJ0omN +euRBqSIWAWvVpr6lNFgXS7TdivXpJXXM5bWWaQ2AlZrAlRXIFfurq/FuwMm4UHbPhHI qXgUDgiVsi2qRHBcxjOL1VOswJCkSHzFMzOqgBvRleW8x0rJG/bSM/4ZuNj1DsPkeLGr tPVSHBxqf3ufitenXNYwtSL6f+t2z48Fuy+16Dj5KGc05DZbRYsFNQbHJM9SO4RR0Rls vRXQ== X-Gm-Message-State: AOJu0Yyotx1F91Ji9jTHobhahQ5dJyZ+IYN5y4qWFgtl40vpbkE4RtMm CRWnBsBX0/mAo7A1FZWl1Zc= X-Received: by 2002:a17:902:d2cd:b0:1bd:fa80:103d with SMTP id n13-20020a170902d2cd00b001bdfa80103dmr9470542plc.25.1695399195555; Fri, 22 Sep 2023 09:13:15 -0700 (PDT) Received: from dw-tp ([49.207.223.191]) by smtp.gmail.com with ESMTPSA id jk12-20020a170903330c00b001bc930d4517sm3673317plb.42.2023.09.22.09.13.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 09:13:14 -0700 (PDT) Date: Fri, 22 Sep 2023 21:43:11 +0530 Message-Id: <87sf765gq0.fsf@doe.com> From: Ritesh Harjani (IBM) To: "Darrick J. Wong" 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 In-Reply-To: <20230922152116.GA11380@frogsfrogsfrogs> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 22 Sep 2023 09:13:37 -0700 (PDT) "Darrick J. Wong" writes: > 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 ? Thanks for pointing out. Will fix it in next rev. > > Otherwise looks good to me... Thanks. I am planning to enhance this integrity test to also cover synchronous dio (already added), buff-io and aiodio writes as well in the next revision. -ritesh