From patchwork Wed Aug 14 04:52:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13762831 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8F6C365; Wed, 14 Aug 2024 04:52:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723611159; cv=none; b=FchudBjXI5iVGTkh+AlzVpEiZcW7vpysfoX1RhyIz1zSkrjTB5KfYjTq2xPvVvIhtEJiI9se3NaYGuClHhvmiM9bn/OZYUYhjHKzVN5cHtXfXFdnlk2moMn3rBTHqFJSL5JyF4AcdtKmjvE6o7fp4sFruwkAI7aMsmDHjwdPigU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723611159; c=relaxed/simple; bh=TyshqFx55BN2h/ekFelHp5JkOa2ChjyXWhHLZJSrQG0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=amW2grvV/bgkAmzhZgVdfH5ALDFz4tsu4V4oDHT4IPRWogm2STIbb4UyZGbjf0WNFJyMCSkUyLv2jruFlsKKMMn0VTQXRSoZ3bXfIu1tfW0xoSlK28wnavi6dkOeQvuz0MERHD4TjXucfRKjFidjU+z/34UOsTxKzIYH+bnmszU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Ka9TfRWQ; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Ka9TfRWQ" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=nz/icJZIWEQmfZWtHl4b92sQ8biRSWlO73Zg7iEhTr4=; b=Ka9TfRWQsHJ8KxdlOdcwp1DpE1 kFEDccLUKaHkkKeZVrf+W0nTWwFw4D+ktws9eXhW8D0syn+FjA4VeM0Mu+2Jiqxm62q7ZbMBwCApB CzvshORPmPEp1NwIMgX+N5aOhCdq9gMerAgtQWeoEdhlkJ/K3ZnERDx8XYBTtbv/AVq1Dk/GXpGTu 0Qr1A1mRhJ7dltxLJHldMVTPcPs36SOvQPb49AkodwkhiDW9fgKsqw3RmA3YtaBVHKwG7VJsb7XF8 jDkEG5uIppBZboMK5tNVLp881rbdSrwc4P936hql4h4hlXOAoyv9EfL+uY09yXPpR+ALXQSXaRvl6 IGrd0rFQ==; Received: from 2a02-8389-2341-5b80-fd16-64b9-63e2-2d30.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:fd16:64b9:63e2:2d30] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1se5zw-00000005jKq-3e8O; Wed, 14 Aug 2024 04:52:37 +0000 From: Christoph Hellwig To: Zorro Lang Cc: "Darrick J. Wong" , fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH 1/5] statx.h: update to latest kernel UAPI Date: Wed, 14 Aug 2024 06:52:10 +0200 Message-ID: <20240814045232.21189-2-hch@lst.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240814045232.21189-1-hch@lst.de> References: <20240814045232.21189-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Update the localy provided statx definition to the latest kernel UAPI, and use it unconditionally instead only if no kernel version is provided. This allows using more recent additions than provided in the system headers. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- src/statx.h | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/src/statx.h b/src/statx.h index 3f239d791..bae1c86f6 100644 --- a/src/statx.h +++ b/src/statx.h @@ -5,6 +5,14 @@ #include #include +/* + * Swizzle the symbol namespace so that we can provide our own version + * overriding the system one that might now have all the latest fields + * under the standard names even when is included. + */ +#define statx_timestamp statx_timestamp_fstests +#define statx statx_fstests + #ifndef AT_STATX_SYNC_TYPE #define AT_STATX_SYNC_TYPE 0x6000 /* Type of synchronisation required from statx() */ #define AT_STATX_SYNC_AS_STAT 0x0000 /* - Do whatever stat() does */ @@ -28,8 +36,6 @@ # endif #endif -#ifndef STATX_TYPE - /* * Timestamp structure for the timestamps in struct statx. * @@ -102,7 +108,8 @@ struct statx { __u64 stx_ino; /* Inode number */ __u64 stx_size; /* File size */ __u64 stx_blocks; /* Number of 512-byte blocks allocated */ - __u64 __spare1[1]; + __u64 stx_attributes_mask; /* Mask to show what's supported in stx_attributes */ + /* 0x40 */ struct statx_timestamp stx_atime; /* Last access time */ struct statx_timestamp stx_btime; /* File creation time */ @@ -114,7 +121,18 @@ struct statx { __u32 stx_dev_major; /* ID of device containing file [uncond] */ __u32 stx_dev_minor; /* 0x90 */ - __u64 __spare2[14]; /* Spare space for future expansion */ + __u64 stx_mnt_id; + __u32 stx_dio_mem_align; /* Memory buffer alignment for direct I/O */ + __u32 stx_dio_offset_align; /* File offset alignment for direct I/O */ + /* 0xa0 */ + __u64 stx_subvol; /* Subvolume identifier */ + __u32 stx_atomic_write_unit_min; /* Min atomic write unit in bytes */ + __u32 stx_atomic_write_unit_max; /* Max atomic write unit in bytes */ + /* 0xb0 */ + __u32 stx_atomic_write_segments_max; /* Max atomic write segment count */ + __u32 __spare1[1]; + /* 0xb8 */ + __u64 __spare3[9]; /* Spare space for future expansion */ /* 0x100 */ }; @@ -139,6 +157,12 @@ struct statx { #define STATX_BLOCKS 0x00000400U /* Want/got stx_blocks */ #define STATX_BASIC_STATS 0x000007ffU /* The stuff in the normal stat struct */ #define STATX_BTIME 0x00000800U /* Want/got stx_btime */ +#define STATX_MNT_ID 0x00001000U /* Got stx_mnt_id */ +#define STATX_DIOALIGN 0x00002000U /* Want/got direct I/O alignment info */ +#define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */ +#define STATX_SUBVOL 0x00008000U /* Want/got stx_subvol */ +#define STATX_WRITE_ATOMIC 0x00010000U /* Want/got atomic_write_* fields */ + #define STATX_ALL 0x00000fffU /* All currently supported flags */ /* @@ -157,9 +181,11 @@ struct statx { #define STATX_ATTR_APPEND 0x00000020 /* [I] File is append-only */ #define STATX_ATTR_NODUMP 0x00000040 /* [I] File is not to be dumped */ #define STATX_ATTR_ENCRYPTED 0x00000800 /* [I] File requires key to decrypt in fs */ - #define STATX_ATTR_AUTOMOUNT 0x00001000 /* Dir: Automount trigger */ -#endif /* STATX_TYPE */ +#define STATX_ATTR_MOUNT_ROOT 0x00002000 /* Root of a mount */ +#define STATX_ATTR_VERITY 0x00100000 /* [I] Verity protected file */ +#define STATX_ATTR_DAX 0x00200000 /* File is currently in DAX state */ +#define STATX_ATTR_WRITE_ATOMIC 0x00400000 /* File supports atomic write operations */ static inline int xfstests_statx(int dfd, const char *filename, unsigned flags, From patchwork Wed Aug 14 04:52:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13762832 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7207B365; Wed, 14 Aug 2024 04:52:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723611162; cv=none; b=W+R1RhD9CYZ9XSVzOfCqWxnvsd2v2KwKA1BZqHFlLd4Yaub85FiIHyYLs3QZjuuudwUlp7R+Q7/U3IOiZHk15yuWD1dzF61bl0Apq5cP6rQ1Re7bUGI28ajOS+TLDI9BbdR1U8dVkXFl0Ts0XDBFlXQfJ1PFkI1UKO37sbux6TU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723611162; c=relaxed/simple; bh=FwkxUtA85ZvpMvh2lhqmJu3bVm/8V7EiKneeXMlzM4w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DVz+D2+Eay0HQ+efNnm/jj6tPIrjhn662Hwb+sZ1Fq4CdvRaFDMUTXkZbNJkL/D+S1m5pzJtDZJKVeR42CdeDm4mwObQn11h1AWZ3r4dMX8NpyFX2zb6i/5QBuN+k3yVvKOXzY4mPpXHnXs2Ke2FTaMdmS9YTcMxlnD8dzfxvfY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=P9i074bz; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="P9i074bz" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=DujxcGjdRTBQfRrN5G4VMYkrTO1OM4IYiQKSOFoAUVU=; b=P9i074bzvGHgazegXUeTNWbMrp g52ghoYubviqTChk1j6X/OVf9gk7S0GFCsOpvrtWoPV38RzDr4mBwBwRw2vf7oDX0zqFcDQP6W7PZ wETNQO+WvVJmXqxKyeJV/gmMbYco+5ZDL5djE/qK+fYvJjJt4zgU1I3scHHdyoVVGIS6cZ3e3ona6 lJ/bDjdP5ZRdJzWzr1ZPl+9HHCmRDhstxAwpKBwVU6RKyI+7tdAjuuiTQ2/5mX9u3cWea+zVEhqGH jlGBL8uk/3S2E+S6tyZ9EjLTSL6zKYWL8+svKxWFMk27FZwS5z1sMCq0NerSXycOmx3idHdKMCdIQ FckwGe3A==; Received: from 2a02-8389-2341-5b80-fd16-64b9-63e2-2d30.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:fd16:64b9:63e2:2d30] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1se5zz-00000005jLF-2GsN; Wed, 14 Aug 2024 04:52:39 +0000 From: Christoph Hellwig To: Zorro Lang Cc: "Darrick J. Wong" , fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH 2/5] add a new min_dio_alignment helper Date: Wed, 14 Aug 2024 06:52:11 +0200 Message-ID: <20240814045232.21189-3-hch@lst.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240814045232.21189-1-hch@lst.de> References: <20240814045232.21189-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Add a new C program to find the minimum direct I/O alignment. This uses the statx stx_dio_offset_align field if provided, then falls back to the BLKSSZGET ioctl for block backed file systems and finally the page size. It is intended as a more capable replacement for the _min_dio_alignment bash helper. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- .gitignore | 1 + src/Makefile | 2 +- src/min_dio_alignment.c | 66 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 src/min_dio_alignment.c diff --git a/.gitignore b/.gitignore index 97c7e0014..36083e9d3 100644 --- a/.gitignore +++ b/.gitignore @@ -207,6 +207,7 @@ tags /src/log-writes/replay-log /src/perf/*.pyc /src/fiemap-fault +/src/min_dio_alignment # Symlinked files /tests/generic/035.out diff --git a/src/Makefile b/src/Makefile index 559209be9..b3da59a0e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -34,7 +34,7 @@ LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \ attr_replace_test swapon mkswap t_attr_corruption t_open_tmpfiles \ fscrypt-crypt-util bulkstat_null_ocount splice-test chprojid_fail \ detached_mounts_propagation ext4_resize t_readdir_3 splice2pipe \ - uuid_ioctl t_snapshot_deleted_subvolume fiemap-fault + uuid_ioctl t_snapshot_deleted_subvolume fiemap-fault min_dio_alignment EXTRA_EXECS = dmerror fill2attr fill2fs fill2fs_check scaleread.sh \ btrfs_crc32c_forged_name.py popdir.pl popattr.py \ diff --git a/src/min_dio_alignment.c b/src/min_dio_alignment.c new file mode 100644 index 000000000..131f60236 --- /dev/null +++ b/src/min_dio_alignment.c @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2024 Christoph Hellwig + */ +#include +#include +#include +#include +#include +#include +#include +#include "statx.h" + +static int min_dio_alignment(const char *mntpnt, const char *devname) +{ + struct statx stx = { }; + struct stat st; + int fd; + + /* + * If the file system supports STATX_DIOALIGN, use the dio_offset_align + * member, as that reports exactly the information that we are asking + * for. + * + * STATX_DIOALIGN is only reported on regular files, so use O_TMPFILE + * to create one without leaving a trace. + */ + fd = open(mntpnt, O_TMPFILE | O_RDWR | O_EXCL, 0600); + if (fd >= 0 && + xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0 && + (stx.stx_mask & STATX_DIOALIGN)) + return stx.stx_dio_offset_align; + + /* + * If we are on a block device and no explicit aligned is reported, use + * the logical block size as a guestimate. + */ + if (stat(devname, &st) == 0 && S_ISBLK(st.st_mode)) { + int dev_fd = open(devname, O_RDONLY); + int logical_block_size; + + if (dev_fd > 0 && + fstat(dev_fd, &st) == 0 && + S_ISBLK(st.st_mode) && + ioctl(dev_fd, BLKSSZGET, &logical_block_size)) { + return logical_block_size; + } + } + + /* + * No support for STATX_DIOALIGN and not a block device: + * default to PAGE_SIZE. + */ + return getpagesize(); +} + +int main(int argc, char **argv) +{ + if (argc != 3) { + fprintf(stderr, "usage: %s mountpoint devicename\n", argv[0]); + exit(1); + } + + printf("%d\n", min_dio_alignment(argv[1], argv[2])); + exit(0); +} From patchwork Wed Aug 14 04:52:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13762833 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEB0E365; Wed, 14 Aug 2024 04:52:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723611164; cv=none; b=dxsYZalFuSeWbWASax5U/+DtEcU/ZgVf/oXcKo/ggOUXt9MSPlIn/uJf+8bhoPDJnzaD7MmjTQOcEnth/3GtdeyeFLgKSmJBW7OgYUM9PFN6oA9z5Shg+yVj5dw9DK6F+NuHc5t4Qkd7Pnx1OFWPzTIpsG97f3vw9qvYYjy4W0c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723611164; c=relaxed/simple; bh=qURh4udtWLx2eWmooYHUzlJr3khUAMBzMrBdrjSWslc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BShSWfU8IdrEQ4b7wtkNxuYMcQT9VLw1dYl5pGrPG6x8jehsU79cKUclJKh1hhNM3zJ+arUT4Oka+gmz89tgvOd+K/rdi7Cv7u4Nofokh8MgDgrXaNfxMyVeuUJ/zG23IbMQ0nFt4OgI20ZAVWXxH1gxOIc5wrJQ9EtZSXxQaGc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=RnVTWoG6; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="RnVTWoG6" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=hlLMrK+oNVnxSLbS4HRtVzrPilh6/SH3BRRUajstIug=; b=RnVTWoG6s1Y7qwwTF1Xgzica7X I5KRbO34qp4nnEiXaxoIQ2CFbWdW3aTsEviDVJb+tQe1LHb3CVAHA87bT+GwK0wOmVo7o62/yYJgd oznmF5r7aY93RntouuRVCHmVc69DEhxLWcXnE/r/1NOx/J63mG2IC+R0KaFdFWacRstz2I0DoHUOT uzi/83W1KWZWDfd7Q6vByRoWSEAy1OiT/0VA08iwrTlKBlrSC4DWC8ykOd994otYrbBkcUZsbsZ6A lQE0D0Vz2a8AwLm/1XvT6dRQwjTzNhNlwNsXqk7HxQ/8k7utP0Hoh2P6lqfhBIBR/RiLH395kvtvX I/qZj3dQ==; Received: from 2a02-8389-2341-5b80-fd16-64b9-63e2-2d30.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:fd16:64b9:63e2:2d30] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1se602-00000005jMc-0KZy; Wed, 14 Aug 2024 04:52:42 +0000 From: Christoph Hellwig To: Zorro Lang Cc: "Darrick J. Wong" , fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH 3/5] xfs/424: don't use _min_dio_alignment Date: Wed, 14 Aug 2024 06:52:12 +0200 Message-ID: <20240814045232.21189-4-hch@lst.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240814045232.21189-1-hch@lst.de> References: <20240814045232.21189-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html xfs/424 tests xfs_db and not the kernel xfs code, and really wants the device sector size and not the minimum direct I/O alignment. Switch to a direct call of the blockdev utility. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- tests/xfs/424 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/xfs/424 b/tests/xfs/424 index 71d48bec1..6078d3489 100755 --- a/tests/xfs/424 +++ b/tests/xfs/424 @@ -50,7 +50,7 @@ echo "Silence is golden." # NOTE: skip attr3, bmapbta, bmapbtd, dir3, dqblk, inodata, symlink # rtbitmap, rtsummary, log # -sec_sz=`_min_dio_alignment $SCRATCH_DEV` +sec_sz=`blockdev --getss $SCRATCH_DEV` while [ $sec_sz -le 4096 ]; do sector_sizes="$sector_sizes $sec_sz" sec_sz=$((sec_sz * 2)) From patchwork Wed Aug 14 04:52:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13762834 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 512DE365; Wed, 14 Aug 2024 04:52:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723611166; cv=none; b=ce1zfg6H0Wezk32eUSzf+yDHS5qkz/h/cTsjTxeIHyQ9BqKT2/VnCZRse0h33wp/SSJ93yJPQ/1EDVmN83R8/pBEmkiytTjSmjJBHDBs8Lt12JWkpq1zWXuR71U41lIyBBnb92v1GDXEFLIO6fPrPPfy7UgmAYxqzo55soj4xok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723611166; c=relaxed/simple; bh=JNF+jw/F299AfHLBt47AOMKtG64Oabh4PP4SEgB2Z6U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GNhNKvagLxqlbPLHJsEO+27oBugYi4YAMKrNlJ9pCSQS9Ogd6P89o7TGwcBUb5kFEouw3gCgg3417TOSAvCTT2SY6uS8THstpHv7sU1x2em0F72St2+mLOC1cnWXH7UDWPbKF3o8+Vc59j1/yTxXn9DJn+iYhsr01U2UQJcdikA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=pDBVwdIv; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="pDBVwdIv" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=rF2jhC21J6tTctc13r8QzT1gux9V1Wt3p4gIKPWlG7s=; b=pDBVwdIvXIIGLgTrhd1eEXwZpJ 8hEhQBPwoeQh7zS7IpGRfpbvBex2AWqMD0xwRx3uOuu1ikl8+mO3QApeL5Vn8XBMJtEz5u4WFIbrK DMqH2JMa2yOKlR/lPCAiLPjCKfY6I9Dkfrt5WdSZASp26yH37U62UeZQkxjDvuh4GVR0L6gbbaqu9 rELnIFtgRDV8Sa2gA2ZIRxb87uXSzqXF61Oa/gP7CRNJTxvaFzSS2woIFn96osv7alcByu8XndEKv OhNW8QuSaz0ysqYBMpOXMqVbERagM4JqX+U469aoWRKAuPtkQ/vUQ7jMd7JV4FVa4wOWUL64PZSFu KLBoB4Mg==; Received: from 2a02-8389-2341-5b80-fd16-64b9-63e2-2d30.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:fd16:64b9:63e2:2d30] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1se604-00000005jNo-2Jup; Wed, 14 Aug 2024 04:52:44 +0000 From: Christoph Hellwig To: Zorro Lang Cc: "Darrick J. Wong" , fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH 4/5] generic: don't use _min_dio_alignment without a device argument Date: Wed, 14 Aug 2024 06:52:13 +0200 Message-ID: <20240814045232.21189-5-hch@lst.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240814045232.21189-1-hch@lst.de> References: <20240814045232.21189-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Replace calls to _min_dio_alignment that do not provide a device to check with calls to the feature utility to query the page size, as that is what these calls actually do. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- tests/generic/521 | 2 +- tests/generic/617 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/generic/521 b/tests/generic/521 index 24eab8342..5f3aac570 100755 --- a/tests/generic/521 +++ b/tests/generic/521 @@ -22,7 +22,7 @@ nr_ops=$((1000000 * TIME_FACTOR)) op_sz=$((128000 * LOAD_FACTOR)) file_sz=$((600000 * LOAD_FACTOR)) fsx_file=$TEST_DIR/fsx.$seq -min_dio_sz=$(_min_dio_alignment) +min_dio_sz=$($here/src/feature -s) fsx_args=(-q) fsx_args+=(-N $nr_ops) diff --git a/tests/generic/617 b/tests/generic/617 index eb50a2da3..297d75538 100755 --- a/tests/generic/617 +++ b/tests/generic/617 @@ -24,7 +24,7 @@ nr_ops=$((20000 * TIME_FACTOR)) op_sz=$((128000 * LOAD_FACTOR)) file_sz=$((600000 * LOAD_FACTOR)) fsx_file=$TEST_DIR/fsx.$seq -min_dio_sz=$(_min_dio_alignment) +min_dio_sz=$($here/src/feature -s) fsx_args=(-S 0) fsx_args+=(-U) From patchwork Wed Aug 14 04:52:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13762835 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D373B365; Wed, 14 Aug 2024 04:52:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723611169; cv=none; b=fjUnoZsfV2/fgUFFwgoqZSg3sRHKPw6Gq1yiQqz59XfC+b7TPxsQBY41EgUq7P5PvGPp+DGydXn+5vW30ccVwKWo4vMp6JOz+V+dcenerngxtbAmm+oP/eqothVHCsVWTku0YBEeVmfY8EKViG5gWM5rvbO62c099HV+IgSF9rI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723611169; c=relaxed/simple; bh=17ZnMIvMbuAAkRsPQGTY8hA9J8r4josB+n9PZ57Ug4U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qjHmXeZ5HGzq2y7n54TMYlTPE/H69DuPyzGMWCIqd4lzlSQr3STRFmGVO82vPQ5M2U9p1HrTjMxPdzL+OPjsVGmbDRlFpkDIp1US2YJSNp1/zub7ZnLSqlK1dPCGEwzRqXhmsIzz+PHqGBYQSeJSeItjW1aJqJDxGgPclw4dKe0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=l2SDwtM/; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="l2SDwtM/" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=LEUMiQJJwz9xT9f4bL5G2uec/hGeR4kPIFPapWkNMHs=; b=l2SDwtM/hiiLLzTbJoG0zyQl9h MJE0Q3O1pG9WyoSt6If9gARwT9wfvzyyeOZjjv3wls8HSUwcCE9EuL/ETq0CT5CCWQ7Ud0HeYWK9f 2hE+ZpuoKSReGPqO4rjERdam2BBBRlC+AUiN3TjSxK//3ibXkHYaDCnLy7g5bhQEYeDC9c23SjWcM UvXGCBOR1g3BcIlQey/VJkVXXpC4aQFFzrMiuFkKqUbNkeWDDJCSyqt84jk2kleWictoPkfsu7SxO TLaMGVg3AzqZJydz2KHKe79Ys2IHzKY6A2zAm3BePSHgXXzAwXakRpRCSStm8vNTr/iMuib+cLY2C dBCaXAmA==; Received: from 2a02-8389-2341-5b80-fd16-64b9-63e2-2d30.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:fd16:64b9:63e2:2d30] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1se606-00000005jP6-43jm; Wed, 14 Aug 2024 04:52:47 +0000 From: Christoph Hellwig To: Zorro Lang Cc: "Darrick J. Wong" , fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH 5/5] replace _min_dio_alignment with calls to src/min_dio_alignment Date: Wed, 14 Aug 2024 06:52:14 +0200 Message-ID: <20240814045232.21189-6-hch@lst.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240814045232.21189-1-hch@lst.de> References: <20240814045232.21189-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Use the min_dio_alignment C tool to check the minimum alignment. This allows using the values obtained from statx instead of just guessing based on the sector size and page size. For tests using the scratch device this sometimes required moving code around a bit to ensure the scratch device is actually mounted before querying the alignment. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- common/rc | 15 --------------- tests/generic/091 | 2 +- tests/generic/095 | 7 ++++--- tests/generic/114 | 2 +- tests/generic/240 | 2 +- tests/generic/252 | 2 +- tests/generic/263 | 2 +- tests/generic/329 | 2 +- tests/generic/330 | 2 +- tests/generic/450 | 2 +- tests/generic/465 | 2 +- tests/generic/538 | 2 +- tests/generic/551 | 2 +- tests/generic/591 | 2 +- tests/xfs/194 | 11 ++++++----- tests/xfs/201 | 47 ++++++++++++++++++++++++----------------------- tests/xfs/237 | 2 +- tests/xfs/239 | 2 +- tests/xfs/556 | 2 +- 19 files changed, 49 insertions(+), 61 deletions(-) diff --git a/common/rc b/common/rc index afc33bbc2..449ac9fbf 100644 --- a/common/rc +++ b/common/rc @@ -4296,21 +4296,6 @@ _scale_fsstress_args() printf '%s\n' "$args" } -# -# Return the logical block size if running on a block device, -# else substitute the page size. -# -_min_dio_alignment() -{ - local dev=$1 - - if [ -b "$dev" ]; then - blockdev --getss $dev - else - $here/src/feature -s - fi -} - run_check() { echo "# $@" >> $seqres.full 2>&1 diff --git a/tests/generic/091 b/tests/generic/091 index 8f7c13da8..5cdf04890 100755 --- a/tests/generic/091 +++ b/tests/generic/091 @@ -16,7 +16,7 @@ _require_test _require_odirect psize=`$here/src/feature -s` -bsize=`_min_dio_alignment $TEST_DEV` +bsize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` # fsx usage: # diff --git a/tests/generic/095 b/tests/generic/095 index 7a0adf880..47e3b1e61 100755 --- a/tests/generic/095 +++ b/tests/generic/095 @@ -16,12 +16,15 @@ _require_scratch _require_odirect _require_aio +_scratch_mkfs >>$seqres.full 2>&1 +_scratch_mount + iodepth=$((16 * LOAD_FACTOR)) iodepth_batch=$((8 * LOAD_FACTOR)) numjobs=$((5 * LOAD_FACTOR)) fio_config=$tmp.fio fio_out=$tmp.fio.out -blksz=$(_min_dio_alignment $SCRATCH_DEV) +blksz=`$here/src/min_dio_alignment $SCRATCH_MNT $SCRATCH_DEV` cat >$fio_config <> $fio_config _require_fio $fio_config -_scratch_mkfs >>$seqres.full 2>&1 -_scratch_mount # There's a known EIO failure to report collisions between directio and buffered # writes to userspace, refer to upstream linux 5a9d929d6e13. So ignore EIO error diff --git a/tests/generic/114 b/tests/generic/114 index 068ed9e26..e0696ad92 100755 --- a/tests/generic/114 +++ b/tests/generic/114 @@ -25,7 +25,7 @@ _require_sparse_files _require_aiodio aio-dio-eof-race # Test does 512 byte DIO, so make sure that'll work -logical_block_size=`_min_dio_alignment $TEST_DEV` +logical_block_size=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` if [ "$logical_block_size" -gt "512" ]; then _notrun "device block size: $logical_block_size greater than 512" diff --git a/tests/generic/240 b/tests/generic/240 index a333873ec..66a2ff74c 100755 --- a/tests/generic/240 +++ b/tests/generic/240 @@ -29,7 +29,7 @@ echo "Silence is golden." rm -f $TEST_DIR/aiodio_sparse -logical_block_size=`_min_dio_alignment $TEST_DEV` +logical_block_size=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` fs_block_size=`_get_block_size $TEST_DIR` file_size=$((8 * $fs_block_size)) diff --git a/tests/generic/252 b/tests/generic/252 index 39fa5531f..3ee2b0a67 100755 --- a/tests/generic/252 +++ b/tests/generic/252 @@ -49,7 +49,7 @@ nr=640 bufnr=128 filesize=$((blksz * nr)) bufsize=$((blksz * bufnr)) -alignment=`_min_dio_alignment $TEST_DEV` +alignment=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` _require_fs_space $SCRATCH_MNT $((filesize / 1024 * 5 / 4)) diff --git a/tests/generic/263 b/tests/generic/263 index 62eaec1d7..91cfbe525 100755 --- a/tests/generic/263 +++ b/tests/generic/263 @@ -16,7 +16,7 @@ _require_test _require_odirect psize=`$here/src/feature -s` -bsize=`_min_dio_alignment $TEST_DEV` +bsize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` run_fsx -N 10000 -o 8192 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z run_fsx -N 10000 -o 128000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z diff --git a/tests/generic/329 b/tests/generic/329 index e29a8ca4c..ab37e047f 100755 --- a/tests/generic/329 +++ b/tests/generic/329 @@ -40,7 +40,7 @@ nr=640 bufnr=128 filesize=$((blksz * nr)) bufsize=$((blksz * bufnr)) -alignment=`_min_dio_alignment $TEST_DEV` +alignment=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` _require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) diff --git a/tests/generic/330 b/tests/generic/330 index 83e1459fa..4fa81f991 100755 --- a/tests/generic/330 +++ b/tests/generic/330 @@ -36,7 +36,7 @@ nr=640 bufnr=128 filesize=$((blksz * nr)) bufsize=$((blksz * bufnr)) -alignment=`_min_dio_alignment $TEST_DEV` +alignment=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` _require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) diff --git a/tests/generic/450 b/tests/generic/450 index 96e559da6..689f1051e 100755 --- a/tests/generic/450 +++ b/tests/generic/450 @@ -31,7 +31,7 @@ _require_test _require_odirect tfile=$TEST_DIR/testfile_${seq} -ssize=`_min_dio_alignment $TEST_DEV` +ssize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` bsize=`_get_block_size $TEST_DIR` # let's focus on the specific bug that only happens when $ssize <= $bsize diff --git a/tests/generic/465 b/tests/generic/465 index eba3629ab..f8c4ea967 100755 --- a/tests/generic/465 +++ b/tests/generic/465 @@ -26,7 +26,7 @@ _require_aiodio aio-dio-append-write-read-race _require_test_program "feature" testfile=$TEST_DIR/$seq.$$ -min_dio_align=`_min_dio_alignment $TEST_DEV` +min_dio_align=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` page_size=`$here/src/feature -s` echo "non-aio dio test" diff --git a/tests/generic/538 b/tests/generic/538 index d6933cbb9..b9cf05de1 100755 --- a/tests/generic/538 +++ b/tests/generic/538 @@ -28,7 +28,7 @@ _require_test _require_aiodio aio-dio-write-verify localfile=$TEST_DIR/${seq}-aio-dio-write-verify-testfile -diosize=`_min_dio_alignment $TEST_DEV` +diosize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` blocksize=`_get_block_size $TEST_DIR` bufsize=$((blocksize * 2)) truncsize=$((bufsize+diosize)) diff --git a/tests/generic/551 b/tests/generic/551 index f2907ac23..4a7f0a638 100755 --- a/tests/generic/551 +++ b/tests/generic/551 @@ -19,7 +19,7 @@ _scratch_mkfs > $seqres.full 2>&1 _scratch_mount localfile=$SCRATCH_MNT/testfile -diosize=`_min_dio_alignment $SCRATCH_DEV` +diosize=`$here/src/min_dio_alignment $SCRATCH_MNT $SCRATCH_DEV` # The maximum write size and offset are both 32k diosize. So the maximum # file size will be (32 * 2)k diff --git a/tests/generic/591 b/tests/generic/591 index c22dc701b..f2fcd6162 100755 --- a/tests/generic/591 +++ b/tests/generic/591 @@ -22,7 +22,7 @@ _require_test _require_odirect _require_test_program "splice-test" -diosize=`_min_dio_alignment $TEST_DEV` +diosize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` $here/src/splice-test -s $diosize -r $TEST_DIR/a $here/src/splice-test -rd $TEST_DIR/a diff --git a/tests/xfs/194 b/tests/xfs/194 index 9abd2c321..1f83d534c 100755 --- a/tests/xfs/194 +++ b/tests/xfs/194 @@ -43,11 +43,6 @@ _scratch_mkfs_xfs >/dev/null 2>&1 # For this test we use block size = 1/8 page size pgsize=`$here/src/feature -s` blksize=`expr $pgsize / 8` -secsize=`_min_dio_alignment $SCRATCH_DEV` - -if [ $secsize -gt $blksize ];then - _notrun "sector size($secsize) too large for platform page size($pgsize)" -fi # Filter out file mountpoint and physical location info # Input: @@ -84,6 +79,12 @@ unset XFS_MKFS_OPTIONS # we need 512 byte block size, so crc's are turned off _scratch_mkfs_xfs -m crc=0 -b size=$blksize >/dev/null 2>&1 _scratch_mount + +secsize=`$here/src/min_dio_alignment $SCRATCH_MNT $SCRATCH_DEV` +if [ $secsize -gt $blksize ];then + _notrun "sector size($secsize) too large for platform page size($pgsize)" +fi + test "$(_get_block_size $SCRATCH_MNT)" = $blksize || \ _notrun "Could not get $blksize-byte blocks" diff --git a/tests/xfs/201 b/tests/xfs/201 index a0d2c9150..60cc84ed2 100755 --- a/tests/xfs/201 +++ b/tests/xfs/201 @@ -24,10 +24,9 @@ _cleanup() file=$SCRATCH_MNT/f -min_align=`_min_dio_alignment $SCRATCH_DEV` - do_pwrite() { + min_align=$3 offset=`expr $1 \* $min_align` end=`expr $2 \* $min_align` length=`expr $end - $offset` @@ -40,28 +39,30 @@ _require_scratch _scratch_mkfs_xfs >/dev/null 2>&1 _scratch_mount +min_align=`$here/src/min_dio_alignment $SCRATCH_MNT $SCRATCH_DEV` + # Create a fragmented file -do_pwrite 30792 31039 -do_pwrite 30320 30791 -do_pwrite 29688 30319 -do_pwrite 29536 29687 -do_pwrite 27216 29535 -do_pwrite 24368 27215 -do_pwrite 21616 24367 -do_pwrite 20608 21615 -do_pwrite 19680 20607 -do_pwrite 19232 19679 -do_pwrite 17840 19231 -do_pwrite 16928 17839 -do_pwrite 15168 16927 -do_pwrite 14048 15167 -do_pwrite 12152 14047 -do_pwrite 11344 12151 -do_pwrite 8792 11343 -do_pwrite 6456 8791 -do_pwrite 5000 6455 -do_pwrite 1728 4999 -do_pwrite 0 1727 +do_pwrite 30792 31039 $min_align +do_pwrite 30320 30791 $min_align +do_pwrite 29688 30319 $min_align +do_pwrite 29536 29687 $min_align +do_pwrite 27216 29535 $min_align +do_pwrite 24368 27215 $min_align +do_pwrite 21616 24367 $min_align +do_pwrite 20608 21615 $min_align +do_pwrite 19680 20607 $min_align +do_pwrite 19232 19679 $min_align +do_pwrite 17840 19231 $min_align +do_pwrite 16928 17839 $min_align +do_pwrite 15168 16927 $min_align +do_pwrite 14048 15167 $min_align +do_pwrite 12152 14047 $min_align +do_pwrite 11344 12151 $min_align +do_pwrite 8792 11343 $min_align +do_pwrite 6456 8791 $min_align +do_pwrite 5000 6455 $min_align +do_pwrite 1728 4999 $min_align +do_pwrite 0 1727 $min_align sync sync diff --git a/tests/xfs/237 b/tests/xfs/237 index 5f264ff44..194cd0459 100755 --- a/tests/xfs/237 +++ b/tests/xfs/237 @@ -41,7 +41,7 @@ nr=640 bufnr=128 filesize=$((blksz * nr)) bufsize=$((blksz * bufnr)) -alignment=`_min_dio_alignment $TEST_DEV` +alignment=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` _require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) _require_congruent_file_oplen $SCRATCH_MNT $blksz diff --git a/tests/xfs/239 b/tests/xfs/239 index 277bd4548..bfe722c0a 100755 --- a/tests/xfs/239 +++ b/tests/xfs/239 @@ -40,7 +40,7 @@ filesize=$((blksz * nr)) bufsize=$((blksz * bufnr)) filesize=$filesize bufsize=$bufsize -alignment=`_min_dio_alignment $TEST_DEV` +alignment=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` _require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) diff --git a/tests/xfs/556 b/tests/xfs/556 index 5a2e7fd6d..79e03caf4 100755 --- a/tests/xfs/556 +++ b/tests/xfs/556 @@ -82,7 +82,7 @@ ENDL # All sector numbers that we feed to the kernel must be in units of 512b, but # they also must be aligned to the device's logical block size. -logical_block_size=$(_min_dio_alignment $SCRATCH_DEV) +logical_block_size=`$here/src/min_dio_alignment $SCRATCH_MNT $SCRATCH_DEV` kernel_sectors_per_device_lba=$((logical_block_size / 512)) # Mark as bad one of the device LBAs in the middle of the extent. Target the