From: Dave Chinner <david@fromorbit.com>
To: fstests@vger.kernel.org
Cc: zlang@kernel.org
Subject: [PATCH 25/28] bulkstat_unlink_test_modified.c: remove unused test code
Date: Thu, 17 Apr 2025 13:01:06 +1000 [thread overview]
Message-ID: <20250417031208.1852171-26-david@fromorbit.com> (raw)
In-Reply-To: <20250417031208.1852171-1-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
The built binary is not used by any test. Remove the dead code.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
.gitignore | 1 -
src/Makefile | 2 +-
src/bulkstat_unlink_test_modified.c | 193 ----------------------------
3 files changed, 1 insertion(+), 195 deletions(-)
delete mode 100644 src/bulkstat_unlink_test_modified.c
diff --git a/.gitignore b/.gitignore
index 4fd817243..feb011c46 100644
--- a/.gitignore
+++ b/.gitignore
@@ -65,7 +65,6 @@ tags
/src/btrfs_encoded_write
/src/bulkstat_null_ocount
/src/bulkstat_unlink_test
-/src/bulkstat_unlink_test_modified
/src/checkpoint_journal
/src/chprojid_fail
/src/cloner
diff --git a/src/Makefile b/src/Makefile
index 6ac72b366..6a31ceb01 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -26,7 +26,7 @@ TARGETS = dirstress fill fill2 getpagesize holes lstat64 \
LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \
preallo_rw_pattern_writer ftrunc trunc fs_perms testx looptest \
locktest unwritten_mmap bulkstat_unlink_test deduperace \
- bulkstat_unlink_test_modified t_dir_offset t_futimens t_immutable \
+ t_dir_offset t_futimens t_immutable \
stale_handle pwrite_mmap_blocked t_dir_offset2 seek_sanity_test \
seek_copy_test t_readdir_1 t_readdir_2 fsync-tester nsexec cloner \
renameat2 t_getcwd e4compact test-nextquota punch-alternating \
diff --git a/src/bulkstat_unlink_test_modified.c b/src/bulkstat_unlink_test_modified.c
deleted file mode 100644
index a106749dc..000000000
--- a/src/bulkstat_unlink_test_modified.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * $Id: bulkstat_unlink_test_modified.c,v 1.1 2007/10/03 16:23:57 mohamedb.longdrop.melbourne.sgi.com Exp $
- * Test bulkstat doesn't returned unlinked inodes.
- * Mark Goodwin <markgw@sgi.com> Fri Jul 20 09:13:57 EST 2007
- *
- * This is a modified version of bulkstat_unlink_test.c to reproduce a specific
- * problem see pv 969192
- */
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <xfs/xfs.h>
-#include <unistd.h>
-#include <string.h>
-
-int
-main(int argc, char *argv[])
-{
- int e;
- int fd = 0;
- int i;
- int j;
- int k;
- int nfiles;
- int stride;
- struct stat sbuf;
- ino_t *inodelist;
- __u32 *genlist;
- struct xfs_fsop_bulkreq a;
- struct xfs_bstat *ret;
- int iterations;
- char fname[MAXPATHLEN];
- char *dirname;
-
- if (argc != 5) {
- fprintf(stderr, "Usage: %s iterations nfiles stride dir\n", argv[0]);
- fprintf(stderr, "Create dir with nfiles, unlink each stride'th file, sync, bulkstat\n");
- exit(1);
- }
-
- iterations = atoi(argv[1]);
- nfiles = atoi(argv[2]);
- stride = atoi(argv[3]);
- dirname = argv[4];
- if (!nfiles || !iterations) {
- fprintf(stderr, "Iterations and nfiles showld be non zero.\n");
- exit(1);
- }
-
- inodelist = (ino_t *)malloc(nfiles * sizeof(ino_t));
- genlist = (__u32 *)malloc(nfiles * sizeof(__u32));
- ret = (struct xfs_bstat *)malloc(nfiles * sizeof(struct xfs_bstat));
-
- for (k=0; k < iterations; k++) {
- xfs_ino_t last_inode = 0;
- int count = 0;
- int testFiles = 0;
-
- printf("Iteration %d ... \n", k);
-
- memset(inodelist, 0, nfiles * sizeof(ino_t));
- memset(genlist, 0, nfiles * sizeof(__u32));
- memset(ret, 0, nfiles * sizeof(struct xfs_bstat));
- memset(&a, 0, sizeof(struct xfs_fsop_bulkreq));
- a.lastip = (__u64 *)&last_inode;
- a.icount = nfiles;
- a.ubuffer = ret;
- a.ocount = &count;
-
- if (mkdir(dirname, 0755) < 0) {
- perror(dirname);
- exit(1);
- }
-
- /* create nfiles and store their inode numbers in inodelist */
- for (i=0; i < nfiles; i++) {
- sprintf(fname, "%s/file%06d", dirname, i);
- if ((fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0644)) < 0) {
- perror(fname);
- exit(1);
- }
- write(fd, fname, sizeof(fname));
- if (fstat(fd, &sbuf) < 0) {
- perror(fname);
- exit(1);
- }
- inodelist[i] = sbuf.st_ino;
- close(fd);
- }
-
- sync();
-
- /* collect bs_gen for the nfiles files */
- if ((fd = open(dirname, O_RDONLY)) < 0) {
- perror(dirname);
- exit(1);
- }
-
- testFiles = 0;
- for (;;) {
- if ((e = xfsctl(dirname, fd, XFS_IOC_FSBULKSTAT, &a)) < 0) {
- perror("XFS_IOC_FSBULKSTAT1:");
- exit(1);
- }
-
- if (count == 0)
- break;
-
- for (i=0; i < count; i++) {
- for (j=0; j < nfiles; j += stride) {
- if (ret[i].bs_ino == inodelist[j]) {
- genlist[j] = ret[i].bs_gen;
- testFiles++;
- }
- }
- }
- }
- close(fd);
-
- printf("testFiles %d ... \n", testFiles);
-
- /* remove some of the first set of files */
- for (i=0; i < nfiles; i += stride) {
- sprintf(fname, "%s/file%06d", dirname, i);
- if (unlink(fname) < 0) {
- perror(fname);
- exit(1);
- }
- }
-
- /* create a new set of files (replacing the unlinked ones) */
- for (i=0; i < nfiles; i += stride) {
- sprintf(fname, "%s/file%06d", dirname, i);
- if ((fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0644)) < 0) {
- perror(fname);
- exit(1);
- }
- write(fd, fname, sizeof(fname));
- close(fd);
- }
-
- sync();
- last_inode = 0; count = 0;
-
- if ((fd = open(dirname, O_RDONLY)) < 0) {
- perror(dirname);
- exit(1);
- }
-
- for (;;) {
- if ((e = xfsctl(dirname, fd, XFS_IOC_FSBULKSTAT, &a)) < 0) {
- perror("XFS_IOC_FSBULKSTAT:");
- exit(1);
- }
-
- if (count == 0)
- break;
-
- for (i=0; i < count; i++) {
- for (j=0; j < nfiles; j += stride) {
- if ((ret[i].bs_ino == inodelist[j]) &&
- (ret[i].bs_gen == genlist[j])) {
- /* oops, the same inode with old gen number */
- printf("Unlinked inode %llu with generation %d "
- "returned by bulkstat\n",
- (unsigned long long)inodelist[j],
- genlist[j]);
- exit(1);
- }
- if (ret[i].bs_ino == inodelist[j] &&
- ret[i].bs_gen != genlist[j] + 1) {
- /* oops, the new gen number is not 1 bigger than the old */
- printf("Inode with old generation %d, new generation %d\n",
- genlist[j], ret[i].bs_gen);
- exit(1);
- }
- }
- }
- }
-
- close(fd);
-
- sprintf(fname, "rm -rf %s\n", dirname);
- system(fname);
-
- sync();
- sleep(2);
- printf("passed\n");
- }
-
- exit(0);
-}
--
2.45.2
next prev parent reply other threads:[~2025-04-17 3:29 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 3:00 [PATCH 00/28] check-parallel: Running tests without check Dave Chinner
2025-04-17 3:00 ` [PATCH 01/28] fstests: remove support for non-numeric test names Dave Chinner
2025-04-30 9:17 ` Nirjhar Roy (IBM)
2025-05-21 2:39 ` Dave Chinner
2025-05-26 5:14 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 02/28] _scratch_mkfs_sized: obey USE_EXTERNAL for XFS filesystems Dave Chinner
2025-05-05 6:14 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 03/28] fstests: move test exit functions to common/exit Dave Chinner
2025-04-17 3:00 ` [PATCH 04/28] check-parallel: report how many tests were _notrun Dave Chinner
2025-05-05 9:58 ` Nirjhar Roy (IBM)
2025-05-21 2:53 ` Dave Chinner
2025-05-26 6:09 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 05/28] check: factor out test list building code Dave Chinner
2025-05-06 11:32 ` Nirjhar Roy (IBM)
2025-05-21 3:55 ` Dave Chinner
2025-05-26 6:48 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 06/28] check-parallel: use common group list parsing code Dave Chinner
2025-05-06 15:56 ` Nirjhar Roy (IBM)
2025-05-21 4:13 ` Dave Chinner
2025-05-26 6:58 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 07/28] check-parallel: adjust concurrency according to CPU count Dave Chinner
2025-05-07 6:45 ` Nirjhar Roy (IBM)
2025-05-21 4:32 ` Dave Chinner
2025-05-26 8:50 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 08/28] check-parallel: add logwrite device support Dave Chinner
2025-05-07 8:18 ` Nirjhar Roy (IBM)
2025-05-21 10:07 ` Dave Chinner
2025-05-26 8:59 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 09/28] check-parallel: allow FSTYP selection from the CLI Dave Chinner
2025-05-07 8:49 ` Nirjhar Roy (IBM)
2025-05-21 10:17 ` Dave Chinner
2025-05-26 9:00 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 10/28] check-parallel: use PID namespaces for runner process isolation Dave Chinner
2025-05-07 9:02 ` Nirjhar Roy (IBM)
2025-05-21 10:19 ` Dave Chinner
2025-05-26 9:04 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 11/28] check-parallel: initial support for specifying device sizes Dave Chinner
2025-05-07 10:05 ` Nirjhar Roy (IBM)
2025-05-21 11:11 ` Dave Chinner
2025-04-17 3:00 ` [PATCH 12/28] config: move config section code to it's own file Dave Chinner
2025-05-09 6:09 ` Nirjhar Roy
2025-05-21 11:28 ` Dave Chinner
2025-04-17 3:00 ` [PATCH 13/28] check-parallel: introduce config file support Dave Chinner
2025-05-09 12:01 ` Nirjhar Roy
2025-05-21 12:23 ` Dave Chinner
2025-04-17 3:00 ` [PATCH 14/28] fstests: further separate sourcing common/rc and common/config from initialisation Dave Chinner
2025-05-10 14:08 ` Nirjhar Roy (IBM)
2025-04-17 3:00 ` [PATCH 15/28] check-parallel: de-batch test execution Dave Chinner
2025-05-09 13:16 ` Nirjhar Roy
2025-04-17 3:00 ` [PATCH 16/28] check-parallel: run sections directly Dave Chinner
2025-05-09 14:03 ` Nirjhar Roy
2025-04-17 3:00 ` [PATCH 17/28] check-parallel: rebuild test list when FSTYP changes Dave Chinner
2025-05-09 16:00 ` Nirjhar Roy
2025-04-17 3:00 ` [PATCH 18/28] check-parallel: create a "results-latest" symlink Dave Chinner
2025-05-10 13:12 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 19/28] check: factor test running Dave Chinner
2025-05-12 13:57 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 20/28] [RFC] check-parallel: run tests directly without using check Dave Chinner
2025-05-13 14:48 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 21/28] generic/531: limit max files per CPU Dave Chinner
2025-05-10 13:15 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 22/28] fsync-tester.c: use syncfs() rather than sync() Dave Chinner
2025-04-30 9:08 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 23/28] open-by-handle.c: " Dave Chinner
2025-04-30 9:02 ` Nirjhar Roy (IBM)
2025-05-21 2:32 ` Dave Chinner
2025-05-26 5:11 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 24/28] " Dave Chinner
2025-04-30 8:56 ` Nirjhar Roy (IBM)
2025-05-21 2:30 ` Dave Chinner
2025-05-26 4:56 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` Dave Chinner [this message]
2025-04-30 8:47 ` [PATCH 25/28] bulkstat_unlink_test_modified.c: remove unused test code Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 26/28] stale-handle.c: use syncfs() rather than sync() Dave Chinner
2025-04-30 8:34 ` Nirjhar Roy (IBM)
2025-05-21 2:24 ` Dave Chinner
2025-04-17 3:01 ` [PATCH 27/28] scaleread: remove dead test code Dave Chinner
2025-04-30 8:10 ` Nirjhar Roy (IBM)
2025-04-17 3:01 ` [PATCH 28/28] xfs/259: no need to call sync Dave Chinner
2025-04-30 7:56 ` Nirjhar Roy (IBM)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250417031208.1852171-26-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=fstests@vger.kernel.org \
--cc=zlang@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox