From patchwork Tue Aug 13 07:35:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13761459 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 DEC9E4963A; Tue, 13 Aug 2024 07:35:34 +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=1723534536; cv=none; b=VM0CyDdh+kWf1F2oPjesBQ0SfGY6UfvE+xSX7+gVYLL+1pfxxEeiGn7c1NgbVKTJ2LXEzDONgmcW9eu2NbiC9ZcFWXwwNcosL4CwVLRLMHmRxWhIp4TqMrQztJ77ydzcRBz3kY4g+WblWy/eVd5FlfbMCHqGJjftJhARa2d2zPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723534536; c=relaxed/simple; bh=6INRYbxyBaR90slWHt6AhzRSHNLCgqRi7avmBq7uSPE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VuqIvtDx9mxrVBeVko/XqUazatJEqOcs53Egg+UEyerqXU/A8uVI8Gm4dTEFSe8nQ6hyYgSI71oNzuLSfWg5gxoDTCL7TSoG8dWRNUJe+8sLjBtLFXRq6jBUXE9EYjXej4ZrEzSn1QOMlCcDC0yGKHOYt98z/yQzgPTRHftCoG8= 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=aoO1FrCS; 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="aoO1FrCS" 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=TKTq0g56Eciv+dfxSKJq7N+C4sB833hjuPkCX2eOkug=; b=aoO1FrCS75toEs1iFxwJ5Uvcpt OX1NsbJfOt4YBk5egdD7EOdGWHLZa57cJ8sNWG52E3qpnKqYGm5XTX0t0fQs8svvBlenfwPYi28AR QmONowwTojoSJ9oXwAyHewNbUF7kRwpXmAYsrpvdIgsOhgdHPUgnY4nZ74woV3Ba4+ZDsWIqTigaF KSnXeXIE4ZHenZN9Yw+7sMRHFf3XFV8TgNoeW+98V+uWolK3bM33iD3De++vadOmbBYwKPKp6yQ71 E+zz2A3wBP1jq2R0QxvitXGeZipQS2omdS79MYjqTgfTXZSR7A56fwZjuBmeM8LZmEwBS2lOtc9+u m9xUDpHw==; Received: from 2a02-8389-2341-5b80-d764-33aa-2f69-5c44.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:d764:33aa:2f69:5c44] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdm45-00000002kVv-3jsu; Tue, 13 Aug 2024 07:35:34 +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: Tue, 13 Aug 2024 09:35:00 +0200 Message-ID: <20240813073527.81072-2-hch@lst.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240813073527.81072-1-hch@lst.de> References: <20240813073527.81072-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@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 --- src/statx.h | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/statx.h b/src/statx.h index 3f239d791..ab29fe22d 100644 --- a/src/statx.h +++ b/src/statx.h @@ -28,8 +28,6 @@ # endif #endif -#ifndef STATX_TYPE - /* * Timestamp structure for the timestamps in struct statx. * @@ -44,6 +42,7 @@ * * __reserved is held in case we need a yet finer resolution. */ +#define statx_timestamp statx_timestamp_fstests struct statx_timestamp { __s64 tv_sec; __s32 tv_nsec; @@ -87,6 +86,7 @@ struct statx_timestamp { * will have values installed for compatibility purposes so that stat() and * co. can be emulated in userspace. */ +#define statx statx_fstests struct statx { /* 0x00 */ __u32 stx_mask; /* What results were written [uncond] */ @@ -102,7 +102,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 +115,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 +151,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 +175,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 Tue Aug 13 07:35:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13761460 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 138EF4963A; Tue, 13 Aug 2024 07:35:38 +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=1723534540; cv=none; b=MBBqCLnowqtY5FIgyTG7NNaVbYALplNmy7MmcEt9pVHlicuN34JI7pBIrJICp1hBYUREhvPMsYcelm39DqPuQ4iqB1SfOoKLmXxpg/pRQe5xzf5IK2/ci0YrGlugmUDWjw7r6R/RcYmbUgZsi8mbeJyOJpVCYqS3CZmwqYamwGY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723534540; c=relaxed/simple; bh=zvB8pz0JGgmEiUSpMl0V2lkxvLX3TtS1nRUrbE4kwsg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KIgEVXuEZng2iEhvdCdUTfpYp80s+8xcsiZP2j1MYKE4zyP3R3Vyh+k6eLEWyeUP1jfNiFPpT/U5xGFDBxxxqqnITIAn+jbpHfUycbvc7P/0AAr+dAn5x8mxCD00pKBWr5kjvaG4hPuRjx6nXJAT6PMPXOUpK1rCEV/lBgRN8HY= 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=QdtwIgzX; 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="QdtwIgzX" 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=JtftmwHqZb/jp0LR1s8R7mO42IavgSwsFgMWe1HxMGE=; b=QdtwIgzXVQee+DygvzoadbSVM/ 4SZgY0bYGvjZiA0SXWfRDueaTluPhW624BbQisur3DYa2UphwJEsW2yiAaP8Ziqv+IsQSexXEEmFa UC9ysawEWxjzozJoNZyDMSdgzRCnl+VIkIUqe2PffgfYn8UqAJzcjDiKtvqYrVt9GC8njExYMSD7b Su31kf0784Axv637attAAYG9SsUC5d+MdBfgiSXhLwKIy3FvIzcl3Ckykn0d7GiBg4Slq9GI8XxHo Od8SFSqcGUiK/MKe0ZikU8nCpXu7TFDyDahSKBypLISecCm+S0BscrPgSCKtkeRjy1NZ2T8aMzKJq 1Zj9uXJA==; Received: from 2a02-8389-2341-5b80-d764-33aa-2f69-5c44.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:d764:33aa:2f69:5c44] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdm49-00000002kWH-3mF5; Tue, 13 Aug 2024 07:35:38 +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: Tue, 13 Aug 2024 09:35:01 +0200 Message-ID: <20240813073527.81072-3-hch@lst.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240813073527.81072-1-hch@lst.de> References: <20240813073527.81072-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@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 --- src/Makefile | 2 +- src/min_dio_alignment.c | 66 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 src/min_dio_alignment.c 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..c3345bfb2 --- /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_alignmenent(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_alignmenent(argv[1], argv[2])); + exit(0); +} From patchwork Tue Aug 13 07:35:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13761461 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 1D3F94963A; Tue, 13 Aug 2024 07:35:43 +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=1723534544; cv=none; b=UHtXoLqWsp1bxY3LnCMgXx2e5nQ2u7pHpd+OPvgiI7CfUn9gmECi8C3D6WeB9HT+beiE027Jj21mMdtKRMZ+P6daw/OlioNA/geZQi8evMtfNw2rAsXPE/Kivi5foSt6Sjsp9MxcKZ8vOCHQI84z27tGCEhCqziGP082sqZr/g0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723534544; c=relaxed/simple; bh=2FZde+pUZgBeHZwaoH2zsOHP9Q/hy3y9AnPMHkP+Mm0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kvx428ve44Mn2MlBH+h9vtW35khAfDS1tp/cqmcuTV6/gtcjmGt0UhTySNUUfAgz4bz48w/LNV5ROZ4eHqcibdvy20lXGYapr68Dxfut9dedD0/Kl6l9uEAmGzJ7iYEnnWsmjbYP3Ku1TNiE/TvCDRhjx7QVciXYn+N57+cBRN4= 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=PsQSc0Aa; 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="PsQSc0Aa" 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=X350blmbc117t9IwCTo6bZmZ616hrE18F1tAipccmm0=; b=PsQSc0Aa/xkaEgjABx8PFfpeP2 iYLePXN5vl/1fqbLiaJnIKjCRrUbleK31XJXqqCLyCUzHUD02j9xgUGtdcrsKIjOhrIESyOTS8r9m OepH5Mxgnmiz+Q0Nn2pOvuQa2r/NeEjT1hAJ7uGwku2HtP9B1NFUBm5hIdxgw9WEfZolpWZc3LLHv HvGinSgHc2Me62lLdHc6Z0qrsJb3A6xCEKEB1lpUyOb/hvTRc64o9ShwAlcGaWPx62aqHDu45iIM5 F0q9RTLEd2IIF8nBjVpOTfBgCW3hA9NJ7tV01BhV5m7hm8PA9JkwVJwX1nQ8KuJEMsb0n91gPr8Jf jeMg3yIA==; Received: from 2a02-8389-2341-5b80-d764-33aa-2f69-5c44.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:d764:33aa:2f69:5c44] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdm4E-00000002kXY-0UfB; Tue, 13 Aug 2024 07:35: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: Tue, 13 Aug 2024 09:35:02 +0200 Message-ID: <20240813073527.81072-4-hch@lst.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240813073527.81072-1-hch@lst.de> References: <20240813073527.81072-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@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 Tue Aug 13 07:35:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13761462 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 DEDF94963A; Tue, 13 Aug 2024 07:35: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=1723534547; cv=none; b=ZppUnMBO+m9fy0EkMNYMRxLeeco2bvW6BS3r0AlKh5SL4z3L5/zopHCH3j6vTUqxcs9VTgW4seclmzhgKjQLqmGSN4EhEAEhdyL7j8iEpVF08DNkG+ZOnuYsAEuwJAgiqYZEICnbhTwJYIct2ooT03ZWf4NS7vh34HoyR17bnG0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723534547; c=relaxed/simple; bh=XZt5rC9uT8JgujVOIE0CGZ6qzdqlnCI4Daa0kppKPTY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JhWcM2FblRQkBhSOzbJRQ2gdf8CGictEE9NKc4fuxZ60gS2nzA17DAublSAhhxUM6Lg6q2a1HIcqF5NOIzwA5yAeEAe3EozTVB18svWGwckX2XX67ZOzlKskGGRPCQf+6SSQvhxrR1juLUuvZlWqC/tkQeKu0LCpjg4lWWjkzvw= 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=u40E+80k; 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="u40E+80k" 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=ndVXm3PIVZgjnF0dZn8SFIlk/M35XvDx40I/A2ZkiMc=; b=u40E+80kmRbdNiV+5nwx9WxYMv DDW12DGvfqNOJcpqbQYA24yGaEts8wF6WHTXY/aYWjF+/1GKOGJc4fP4hs0/TQfSnBlInP7ZqDstb YCMyQlZZpCQcoo78Da2DNucmzgAomvnY6Mb+JOx3Ni9EiXxmSILizINBWFc/m1WpC5fRGeaJyCBKn lflIBRNyUr5/kAaxI4HET9eaSBef66+SWSlgTRRKeLYjgGFj6jOtYE199oS/738qS0hJwxuJtXwjA 1qhwNXQpFX6lbnp2OrLSg6phjKKxYG2Oa7BnSLIKQx8CMoBf2sljeXX9VVIinMeoaGrOS8Scg+7h2 Y2p4UgQQ==; Received: from 2a02-8389-2341-5b80-d764-33aa-2f69-5c44.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:d764:33aa:2f69:5c44] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdm4G-00000002kZV-47Fy; Tue, 13 Aug 2024 07:35:45 +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: Tue, 13 Aug 2024 09:35:03 +0200 Message-ID: <20240813073527.81072-5-hch@lst.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240813073527.81072-1-hch@lst.de> References: <20240813073527.81072-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@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 Tue Aug 13 07:35:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13761463 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 98E044963A; Tue, 13 Aug 2024 07:35:49 +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=1723534551; cv=none; b=gncGW9LhkGH99yciDFDKqdBD1mUr4ZwgcZAF9B7nmVFzuWvIbs4zjvzeEy83iYxquCKBQ9zCogdEu/NLyi/KfkYXSDq+GHdYzkOfv5DKJh37Z0wMylWyHHcDCD3S/HlqeGYe58Lbb0KLv5XPi912S/1CSn4V3Zakef/bpxoh7os= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723534551; c=relaxed/simple; bh=53sQoygSINKBzuC7vTU2revYdG/+6xIUjulDNeiLDyc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LdbxQEtFiE0QELCSpJwOkoj0hV1eCJdUHr496JKCVAHe799/vjSmk4XJeThDii0SBc+uD1bPVphLKFGfy9vL+g//zxx99MZkb8VwykJbFiT0Ss3fogikqD7ZRKpQMA/lDerqyuSTN+cfUVdO+SuUIz5X/7dSvIrGQw3uEwvuD6Y= 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=NIsaGGxt; 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="NIsaGGxt" 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=DRF3WyCoVarOHR0NgLtFVN6NPIntjB5TutlCoBHPRBo=; b=NIsaGGxtdUscI6si7l8sGpHAtp 22SBhZR6ll43YcHhrEQTDic/wHc46lUIAWJuWeh0x0FYGzZKmUmaUPWPa7gm/gV7qg47XXMHNSEmv voC20wfeE3lb8dWrLdO+gJuhWaocxN1vCm0KfXc+uWfGst/Jepr3+qH6uI2OD09yOdp/eXKgF+MXL 3+Kun/QhZvy/nXcS6VtFkIxorwQI5iov2O0l2Yf3chfFghHM/GIfORMwOPsrRxb3d47hp1pbSORMx 9qi7Knh2H53Okvk/AEJDjyOBz9oD0fKDEVdUAJex+bio5DMtcAtw/SAZ+c5ss+s4TcQRFsMsMlOhN +sY5E2pw==; Received: from 2a02-8389-2341-5b80-d764-33aa-2f69-5c44.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:d764:33aa:2f69:5c44] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdm4K-00000002kau-1xNe; Tue, 13 Aug 2024 07:35:49 +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: Tue, 13 Aug 2024 09:35:04 +0200 Message-ID: <20240813073527.81072-6-hch@lst.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240813073527.81072-1-hch@lst.de> References: <20240813073527.81072-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@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