Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp141927rdh; Sat, 23 Sep 2023 05:05:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGwl8Us2BEAdHJ1isVR3OFumm9xtHg/EWHhqMFhlUwEsPFI5SShMe1yv/EfzIGusUjn7+Iy X-Received: by 2002:a05:6a00:21d5:b0:690:c75e:25c8 with SMTP id t21-20020a056a0021d500b00690c75e25c8mr1642836pfj.7.1695470743886; Sat, 23 Sep 2023 05:05:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695470743; cv=none; d=google.com; s=arc-20160816; b=exz1DbTCA9JTPB1um/xfNxRRerBoIdVbWgKMlPRDpYOfYDe1TfTd4tPD7DdCQUxoiu z4UbdgP8YLFn9f/VG/kUDGAuoaMdiQNAJZMp/Pwj//iJk62pQ7bpU+ZI8PpI+iqQ4CDu nGDZtOadb09i8emcnPnFWC7EcBO0RMkNbI3Erm3unWxJn9/FI52F0xc2q0io5cLzzdor 6ihgcs8We7j0Gbz0w0R2TxoPljX2Ge/EgMQ3MMTwQxJdIBVzf446iO427P6NiwaCbKRD puuTGUBkhyW6uWQmsIPKJutsUc6iaa4iokm9ZuHuVuAOxZK/UheKv3RG38srGVP9ZopL uOpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T7+cBpujNUS3XYFWbitFbs4F9jMbA+6Zty15gUpWh5E=; fh=ky5erwFVtA2YbsM9HVohrjjjlZnmV9ep7+rwUrYnDo4=; b=JHCTy7F/LnWKxx4qHFt1r3VaVTMTwtZx5/IN1+zYwoH4BrEk/S34UemJaprjD0t6CR QoE0RgoH4ELx+SCp5iesIqMAALsRhEH71qkh+WMb51AoFg5T5wKpKvR63dKArSqN8JRg GojsaRS9pc4PhkruFIzy8hqVH2SUTcz1hSC/CzLYjcV6kmE2PUB/osPMeO5WUlMXRqBM 4JnvQKJsaEdZghh/t1+embS0Qbf+hBOCi6CkBvyTNp4KfXcC449VGXe0Tefza5JrPqtD AiqdIQ2St2R28N+vHLBCR5f2QzDFIovZiYeLh2WtFlmFxLJsS9THAHoCyU8uvVQ+y+VB 5r5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bkQ7f5uF; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id e9-20020a636909000000b0056a9544e894si5678439pgc.397.2023.09.23.05.05.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 05:05:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bkQ7f5uF; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 0910C80879E6; Sat, 23 Sep 2023 05:00:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231343AbjIWMAq (ORCPT + 99 others); Sat, 23 Sep 2023 08:00:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230458AbjIWMAp (ORCPT ); Sat, 23 Sep 2023 08:00:45 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C82A136; Sat, 23 Sep 2023 05:00:39 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-565e54cb93aso1973647a12.3; Sat, 23 Sep 2023 05:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695470438; x=1696075238; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T7+cBpujNUS3XYFWbitFbs4F9jMbA+6Zty15gUpWh5E=; b=bkQ7f5uFZvI21bm45J36jhjNiinCYA3UxXWjiimOoIfqmCCBoR1PY743Av1ydMAkww poV7fH+4b7S4BUkwcFrh8X+FA/jPPCfzOkRoHZsFE88m2WE5XMbchtvSWmsZ/E0GW8gZ oK9GjaGpuDdlpdcGe4D3zPNACbJKsCF6ThsRTzHgWBiaStrgVDwu8figcJ5BK+Fwyaw8 Ws7DzePpzYHJleJjIpeDKFXeR1UV6HyuuWIV/mk84sfAx3BgIvOFSKVMn8UljVcbWGkX TaKDgGt4JTzmLZa8IHgX1Iv7IJrVxdYnKrm3Y3F9ZIw5d02CkC9goL+6D8rd/i5gCECt BcDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695470438; x=1696075238; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T7+cBpujNUS3XYFWbitFbs4F9jMbA+6Zty15gUpWh5E=; b=GtKns5dh69inNM43VGJEtAFTBYXcAQ0kewkTq95IqDSk+Oh6b0gDatr4DwjKqs/tMG fSTag3QKxjYSY58l1Prh3Yo4NqMvlqSowdiujoGlixI7redINmwgAMiYDdV0W8ZNwDcI 1fDNwIuO0y5kFk+a1xnVWc+FVVkl/YerT49PdHeehfALaQrVy6zKTEFZd+E2rGkRBh9m 8AvEKDfAePF2IwQGLxZvZHFYgMQZnmvV10HfeSxQm04V5p0jIkaIslWkjc8au+pIV1sF ceMCZ/W/WZtY3SpUI37GQd9txDf/zDD11CbXbjxT2hggNwcsxFQBBUQ1VWXE/xoJWqZu 3HgA== X-Gm-Message-State: AOJu0YzK/ST4+fmJtUFecGjLBY/uTkov+TzlDti/IOr44iQ0d5R8h8c2 v2cJ5CFmCJtdTDJL/TO7We2+2Dt5TUc= X-Received: by 2002:a05:6a20:101a:b0:14b:3681:567e with SMTP id gs26-20020a056a20101a00b0014b3681567emr1502920pzc.29.1695470438278; Sat, 23 Sep 2023 05:00:38 -0700 (PDT) Received: from dw-tp.ihost.com ([49.207.223.191]) by smtp.gmail.com with ESMTPSA id jg13-20020a17090326cd00b001bba669a7eesm5194981plb.52.2023.09.23.05.00.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 05:00:37 -0700 (PDT) From: "Ritesh Harjani (IBM)" To: fstests@vger.kernel.org Cc: linux-ext4@vger.kernel.org, Jan Kara , Theodore Ts'o , "Ritesh Harjani (IBM)" Subject: [PATCHv2 1/2] aio-dio-write-verify: Add sync and noverify option Date: Sat, 23 Sep 2023 17:30:23 +0530 Message-ID: <3b86ab1f1447f0b6db88d4dfafe304fd04ae2b11.1695469920.git.ritesh.list@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <87y1gy5s9c.fsf@doe.com> References: <87y1gy5s9c.fsf@doe.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Sat, 23 Sep 2023 05:00:46 -0700 (PDT) X-Spam-Level: ** This patch adds -S for O_SYNC and -N for noverify option to aio-dio-write-verify test. We will use this for integrity verification test for aio-dio. Signed-off-by: Ritesh Harjani (IBM) --- src/aio-dio-regress/aio-dio-write-verify.c | 29 ++++++++++++++++------ 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/aio-dio-regress/aio-dio-write-verify.c b/src/aio-dio-regress/aio-dio-write-verify.c index 302b8fe4..61519f6e 100644 --- a/src/aio-dio-regress/aio-dio-write-verify.c +++ b/src/aio-dio-regress/aio-dio-write-verify.c @@ -34,13 +34,16 @@ void usage(char *progname) { - fprintf(stderr, "usage: %s [-t truncsize ] <-a size=N,off=M [-a ...]> filename\n" + fprintf(stderr, "usage: %s [-t truncsize ] <-a size=N,off=M [-a ...]> [-S] [-N] filename\n" "\t-t truncsize: truncate the file to a special size before AIO wirte\n" "\t-a: specify once AIO write size and startoff, this option can be specified many times, but less than 128\n" "\t\tsize=N: AIO write size\n" "\t\toff=M: AIO write startoff\n" - "e.g: %s -t 4608 -a size=4096,off=512 -a size=4096,off=4608 filename\n", - progname, progname); + "\t-S: uses O_SYNC flag for open. By default O_SYNC is not used\n" + "\t-N: no_verify: means no write verification. By default noverify is false\n" + "e.g: %s -t 4608 -a size=4096,off=512 -a size=4096,off=4608 filename\n" + "e.g: %s -t 1048576 -a size=1048576 -S -N filename\n", + progname, progname, progname); exit(1); } @@ -281,8 +284,10 @@ int main(int argc, char *argv[]) char *filename = NULL; int num_events = 0; off_t tsize = 0; + int o_sync = 0; + int no_verify = 0; - while ((c = getopt(argc, argv, "a:t:")) != -1) { + while ((c = getopt(argc, argv, "a:t:SN")) != -1) { char *endp; switch (c) { @@ -297,6 +302,12 @@ int main(int argc, char *argv[]) case 't': tsize = strtoul(optarg, &endp, 0); break; + case 'S': + o_sync = O_SYNC; + break; + case 'N': + no_verify = 1; + break; default: usage(argv[0]); } @@ -313,7 +324,7 @@ int main(int argc, char *argv[]) else usage(argv[0]); - fd = open(filename, O_DIRECT | O_CREAT | O_TRUNC | O_RDWR, 0600); + fd = open(filename, O_DIRECT | O_CREAT | O_TRUNC | O_RDWR | o_sync, 0600); if (fd == -1) { perror("open"); return 1; @@ -331,9 +342,11 @@ int main(int argc, char *argv[]) return 1; } - if (io_verify(fd) != 0) { - fprintf(stderr, "Data verification fails\n"); - return 1; + if (no_verify == 0) { + if (io_verify(fd) != 0) { + fprintf(stderr, "Data verification fails\n"); + return 1; + } } close(fd); -- 2.41.0