Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2142703rdb; Mon, 20 Nov 2023 03:19:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IEuLJ8nQQcpsXBo5CMUpPH3cd3LkPVNnkOD+zCn/v9/MlFCfkar0rl3o2QkTFafHdknXuMa X-Received: by 2002:a05:6a00:8c5:b0:6be:4e6e:2a85 with SMTP id s5-20020a056a0008c500b006be4e6e2a85mr7899279pfu.30.1700479196458; Mon, 20 Nov 2023 03:19:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700479196; cv=none; d=google.com; s=arc-20160816; b=0SgnzFPMpRUkFsLA+Mg3+vuCbzDetv9lODwEjJV0EG1ihnmt4wSsEElJNwLxpSJLyT 8hNlfZpsP+4ZhvqyRduwl+O4f3LGuArB+K2wRQ2TpcHWR6KtBl8MXoPvEm5T9YedRZHc y+u4+iTr/7i6kONg0zgXDjkHbg65KVV0sHf6Y/M2gjwhh52G5K9exWGFdMcnEEC6KZWJ d3Gb0ppdL/LpL2Es7HvC+FBbt8gaAqnkSbtxkb+IEoLFzNE5CmfmSmL0+QUTW3uMQn42 MozMbPGdqnf1Z+di6gMp57ELb2MOfDz+zPuuy9VTdPR4SdX1+pkETJ/zwNFxbV2qOWG2 u+EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=zMufP4ayA3BAkJDGecSSzOF4cEhWy6XzcnwpQLTl9Sw=; fh=KCs4WDQQKMlA870dPYinDLCZwDJjI6KBF8m5ZjUE9Ss=; b=mGT2do+rV9by+yPzw5gLhXc0b0vggCubmFklcVca/4LN+qYoX61ug8ixeYnejq6Q8O jxCRLZysJ6+2SMHZyesCpnohMoOkYQtdjAZ5LhRW2q9cNJS0zIa2uygMQW/S0gMSWd03 mkXNV+PUjNRgapjJMBNLFhq0gtSSl4zdap7wfhXyd19G9ZOElg5vOcLN2RyCsTWX7aph uQdt1ll5d4+qc+88TWuFo6KvNub/1SXIi+TjU1gCwVEPdNMWuwi0t4fL+WJEWw+59GTv 7pPlrD0cGnRBKYdefQKtd/S8hagZxNg1jTDhOwMYUboBxxhC/hW8B9SgXixrPRGWLSTM uopA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=T9IqkQb2; spf=pass (google.com: domain of linux-ext4+bounces-38-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-38-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s186-20020a635ec3000000b0057821ea0674si8548303pgb.812.2023.11.20.03.19.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 03:19:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-38-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=T9IqkQb2; spf=pass (google.com: domain of linux-ext4+bounces-38-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-38-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 838E22826CB for ; Mon, 20 Nov 2023 11:19:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD6CA1429B; Mon, 20 Nov 2023 11:19:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="T9IqkQb2" X-Original-To: linux-ext4@vger.kernel.org Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C32319AD; Mon, 20 Nov 2023 03:19:43 -0800 (PST) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6c4eb5fda3cso4387839b3a.2; Mon, 20 Nov 2023 03:19:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700479182; x=1701083982; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zMufP4ayA3BAkJDGecSSzOF4cEhWy6XzcnwpQLTl9Sw=; b=T9IqkQb2kFE6Jcteup1kGmMe6VcmTbB9a24KCALPKlofSq5HaXZNPPcYOkzxfDRCwv WO3JwqeAwAUmTj1+CdCEjT9ZZXDyRLU6zPAaoFE7wxRqPszABdDjlaGn6tsCKSqbzVvv iPAtBttn4DtHhwaNiKP8MIzUp8PTfDVLKN/3NAx6JzN956nXkuUtE73QNecXfD2ksnqZ dc7g6PiHQn7jZxu+P9o28a1thIHgl3nIOGTkEmYQS4ghGVo6wO+mc2aGkN6It1iastpH 7d48EwjIgCQo+WDHt2UDe+5ze5NGfeMD5NT+59G06Lgyh8oEnt0dGkU5orPQCCmN1F3M gIqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700479182; x=1701083982; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zMufP4ayA3BAkJDGecSSzOF4cEhWy6XzcnwpQLTl9Sw=; b=Hc0xuaD7NSo8sVRBsaKlGvuiYKjITuUrzmerNjawGLh9rVjwrTe7XbKJ/ln4g0+pPh JEQyU9alqgfiXI4+FiYLThh37rbzV4PJNUW/dRi1qJ8YqcV7rpGCsnuyMAo4wJAkM59p 9MKmSTOThoXIPanBY9FrjvUbfS6W/ANH0IqHJKbj5a0LS14Y9kqZr5g+7VjJtQAGZNWR W6VberO1iZ8podZTrxyNK3fP8zaP0M3nhOMMqF7jVSDpV2Cv4mL0j+VPi9Png7ddjSVL qnhrAxwPO7NDPeytwLONbSY6ig82ylvs+mPDuRuPFbYQLlLBvz3RS3QhVSJPyHrWGD84 zoEg== X-Gm-Message-State: AOJu0Yw9DXMDibB9dgIDd/D/Mt2xOXYl9Nan/PIDlUfDZ/ZyZNluOLgi ucq7a0zhqcuTLpmPYycyDY6Yo93YIJg= X-Received: by 2002:a05:6a00:1c94:b0:6c3:5f49:6da7 with SMTP id y20-20020a056a001c9400b006c35f496da7mr8219474pfw.2.1700479181866; Mon, 20 Nov 2023 03:19:41 -0800 (PST) Received: from dw-tp.c4p-in.ibmmobiledemo.com ([129.41.58.19]) by smtp.gmail.com with ESMTPSA id k10-20020aa788ca000000b006cb6ba5fe72sm3056158pff.122.2023.11.20.03.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 03:19:41 -0800 (PST) From: "Ritesh Harjani (IBM)" To: fstests@vger.kernel.org Cc: linux-ext4@vger.kernel.org, Jan Kara , Gao Xiang , Ojaswin Mujoo , "Ritesh Harjani (IBM)" Subject: [PATCHv3 1/2] aio-dio-write-verify: Add sync and noverify option Date: Mon, 20 Nov 2023 16:49:33 +0530 Message-ID: <8379b5df9f70a1d75692e029a565199e98a535e8.1700478575.git.ritesh.list@gmail.com> X-Mailer: git-send-email 2.41.0 Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 dabbfacd..a7ca8307 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); } @@ -292,8 +295,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) { @@ -308,6 +313,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]); } @@ -324,7 +335,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; @@ -342,9 +353,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