From: Christoph Hellwig Date: Mon, 24 Feb 2020 22:29:26 +0000 (-0800) Subject: fstests: remove generic/484 X-Git-Tag: v2022.05.01~854 X-Git-Url: http://git.apps.os.sepia.ceph.com/?p=xfstests-dev.git;a=commitdiff_plain;h=fd2366c6cd3eeb6b7ec711b1675e5e47d526a667 fstests: remove generic/484 Generic/484 tests functionality that isn't really related to file systems, and has failed every since it was added. Remove it as it serves no puropse in xfstests. [Eryu: also remove src/t_locks_execve.c and its entries in src/Makefile and .gitignore] Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Eryu Guan --- diff --git a/.gitignore b/.gitignore index 7e6b7daf..a26a004d 100644 --- a/.gitignore +++ b/.gitignore @@ -129,7 +129,6 @@ /src/t_getcwd /src/t_holes /src/t_immutable -/src/t_locks_execve /src/t_mmap_collision /src/t_mmap_cow_race /src/t_mmap_dio diff --git a/src/Makefile b/src/Makefile index b015e78b..643c1916 100644 --- a/src/Makefile +++ b/src/Makefile @@ -16,7 +16,8 @@ TARGETS = dirstress fill fill2 getpagesize holes lstat64 \ holetest t_truncate_self t_mmap_dio af_unix t_mmap_stale_pmd \ t_mmap_cow_race t_mmap_fallocate fsync-err t_mmap_write_ro \ t_ext4_dax_journal_corruption t_ext4_dax_inline_corruption \ - t_ofd_locks t_locks_execve t_mmap_collision mmap-write-concurrent + t_ofd_locks t_mmap_collision mmap-write-concurrent \ + t_get_file_time t_create_short_dirs t_create_long_dirs LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \ preallo_rw_pattern_writer ftrunc trunc fs_perms testx looptest \ diff --git a/src/t_locks_execve.c b/src/t_locks_execve.c deleted file mode 100644 index d99d7de7..00000000 --- a/src/t_locks_execve.c +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static void err_exit(char *op, int errn) -{ - fprintf(stderr, "%s: %s\n", op, strerror(errn)); - exit(errn); -} - -void *thread_fn(void *arg) -{ - /* execve will release threads */ - while(1) sleep(1); - return NULL; -} - -struct flock fl = { - .l_type = F_WRLCK, - .l_whence = SEEK_SET, - .l_start = 0, - .l_len = 1, -}; - -static void checklock(int fd) -{ - pid_t pid; - - pid = fork(); - if (pid < 0) - err_exit("fork", errno); - - if (!pid) { - if (fcntl(fd, F_GETLK, &fl) < 0) - err_exit("getlk", errno); - if (fl.l_type == F_UNLCK) { - printf("record lock is not preserved across execve(2)\n"); - exit(1); - } - exit(0); - } - - waitpid(pid, NULL, 0); - - exit(0); -} - -int main(int argc, char **argv) -{ - int fd, flags; - char fdstr[10]; - char *newargv[] = { argv[0], argv[1], fdstr, NULL }; - pthread_t th; - - /* passing fd in argv[2] in execve */ - if (argc == 3) { - fd = atoi(argv[2]); - checklock(fd); - } - - fd = open(argv[1], O_WRONLY|O_CREAT, 0755); - if (fd < 0) - err_exit("open", errno); - if (fcntl(fd, F_SETLK, &fl) < 0) - err_exit("setlk", errno); - - /* require multithread process to reproduce the issue */ - pthread_create(&th, NULL, thread_fn, &fd); - - if ((flags = fcntl(fd, F_GETFD)) < 0) - err_exit("getfd", errno); - flags &= ~FD_CLOEXEC; - if (fcntl(fd, F_SETFD, flags) < 0) - err_exit("setfd", errno); - - snprintf(fdstr, sizeof(fdstr), "%d", fd); - execve(argv[0], newargv, NULL); - - return 0; -} diff --git a/tests/generic/484 b/tests/generic/484 deleted file mode 100755 index d83380ac..00000000 --- a/tests/generic/484 +++ /dev/null @@ -1,51 +0,0 @@ -#! /bin/bash -# SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2018 Red Hat Inc. All Rights Reserved. -# -# FS QA Test 484 -# -# POSIX requires that record locks are preserved across an execve(2). But -# there's bug that record locks are released if process is multithreaded at the -# time that execve is called. -# -# Fixed by patch from Jeff Layton: -# locks: change POSIX lock ownership on execve when files_struct is displaced -# -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter - -# remove previous $seqres.full before test -rm -f $seqres.full - -# real QA test starts here -_supported_fs generic -_supported_os Linux -_require_test -_require_test_program "t_locks_execve" - -# prepare a 4k testfile in TEST_DIR -$XFS_IO_PROG -f -c "pwrite -S 0xFF 0 4096" \ - $TEST_DIR/t_lock_execve_file >> $seqres.full 2>&1 - -$here/src/t_locks_execve $TEST_DIR/t_lock_execve_file - -# success, all done -echo "Silence is golden" -status=0 -exit diff --git a/tests/generic/484.out b/tests/generic/484.out deleted file mode 100644 index 94f2f0bd..00000000 --- a/tests/generic/484.out +++ /dev/null @@ -1,2 +0,0 @@ -QA output created by 484 -Silence is golden diff --git a/tests/generic/group b/tests/generic/group index ff79a597..dc95b77b 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -486,7 +486,6 @@ 481 auto quick log metadata 482 auto metadata replay 483 auto quick log metadata -484 auto quick 485 auto quick insert 486 auto quick attr 487 auto quick eio