* [PATCH blktests] loop: remove loop/006 which tests swapping loop fds
@ 2026-10-20 5:41 Shin'ichiro Kawasaki
2026-10-28 12:22 ` Shin'ichiro Kawasaki
0 siblings, 1 reply; 2+ messages in thread
From: Shin'ichiro Kawasaki @ 2026-10-20 5:41 UTC (permalink / raw)
To: linux-block; +Cc: Jan Kara, Christian Brauner, Shin'ichiro Kawasaki
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
The loop driver is going to drop the support of swapping loop fds. The
commit titled "loop: remove support for swapping loop fds" is going to
be applied to kernel version v7.4-rc1, and LOOP_CHANGE_FD ioctl is going
to be removed.
The test case loop/006 checks the behavior of the swapping loop fds.
Failure of the test case is expected after the kernel commit. The test
case no longer has value. Hence remove it.
Link: https://lore.kernel.org/linux-block/as8-8rDJmUb1FxbP@shinmob/
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
src/.gitignore | 1 -
src/Makefile | 1 -
src/loop_change_fd.c | 48 ---------------------------
tests/loop/006 | 78 --------------------------------------------
tests/loop/006.out | 2 --
5 files changed, 130 deletions(-)
delete mode 100644 src/loop_change_fd.c
delete mode 100755 tests/loop/006
delete mode 100644 tests/loop/006.out
diff --git a/src/.gitignore b/src/.gitignore
index f9a3916..54413a7 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -3,7 +3,6 @@
/dio-offsets
/discontiguous-io
/loblksize
-/loop_change_fd
/loop_get_status_null
/metadata
/metadata-iopoll
diff --git a/src/Makefile b/src/Makefile
index 1e571c6..07a5791 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -18,7 +18,6 @@ C_TARGETS := \
bio-full-trim \
dio-offsets \
loblksize \
- loop_change_fd \
loop_get_status_null \
mmap-loss \
mount_clear_sock \
diff --git a/src/loop_change_fd.c b/src/loop_change_fd.c
deleted file mode 100644
index b124d82..0000000
--- a/src/loop_change_fd.c
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <linux/loop.h>
-
-void usage(const char *progname)
-{
- fprintf(stderr, "usage: %s LOOPDEV PATH\n", progname);
- exit(EXIT_FAILURE);
-}
-
-int main(int argc, char **argv)
-{
- int ret;
- int fd, filefd;
-
- if (argc != 3)
- usage(argv[0]);
-
- fd = open(argv[1], O_RDWR);
- if (fd == -1) {
- perror("open");
- return EXIT_FAILURE;
- }
-
- filefd = open(argv[2], O_RDWR);
- if (filefd == -1) {
- perror("open");
- return EXIT_FAILURE;
- }
-
- ret = ioctl(fd, LOOP_CHANGE_FD, filefd);
- if (ret == -1) {
- perror("ioctl");
- close(fd);
- close(filefd);
- return EXIT_FAILURE;
- }
- close(fd);
- close(filefd);
- return EXIT_SUCCESS;
-}
diff --git a/tests/loop/006 b/tests/loop/006
deleted file mode 100755
index 701d44c..0000000
--- a/tests/loop/006
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/bash
-# SPDX-License-Identifier: GPL-3.0+
-# Copyright (C) 2018 Jan Kara
-#
-# Regression test for patch "block/loop: Use global lock for ioctl() operation."
-# We swap file (through LOOP_CHANGE_FD) under one loopback device while
-# creating and deleting another loopback device pointing to the first one.
-# This checks for races in validation of backing fd.
-
-. tests/loop/rc
-
-DESCRIPTION="change loop backing file while creating/removing another loop device"
-# Try for some time to trigger the race
-TIMED=1
-
-requires() {
- _have_src_program loop_change_fd
-}
-
-# Setup and tear down loop device pointing to loop_dev
-run_setter() {
- loop_dev="$1"
-
- while top_dev=$(losetup -f --show "$loop_dev"); do
- losetup -d "$top_dev"
- done
-}
-
-# Switch backing file of loop_dev continuously
-run_switcher() {
- loop_dev="$1"
-
- i=1
- while src/loop_change_fd "$loop_dev" "$TMPDIR/file$i"; do
- i=$(((i+1)%2))
- done
-}
-
-test() {
- echo "Running ${TEST_NAME}"
-
- truncate -s 1M "$TMPDIR/file0"
- truncate -s 1M "$TMPDIR/file1"
-
- if ! loop_dev="$(losetup -r -f --show "$TMPDIR/file0")"; then
- return 1
- fi
-
- run_switcher "$loop_dev" &
- switch_pid=$!
- run_setter "$loop_dev" &
- set_pid=$!
-
- sleep "${TIMEOUT:-30}"
-
- # Discard KILLED messages from bash...
- {
- kill -9 $switch_pid
- wait $switch_pid
- kill -9 $set_pid
- wait $set_pid
- sleep 1
- } 2>/dev/null
-
- # Clean up devices
- top_dev=$(losetup -j "$loop_dev" | sed -e 's/\([^:]*\): .*/\1/')
- if [[ -n "$top_dev" ]]; then
- losetup -d "$top_dev"
- fi
- losetup -d "$loop_dev"
-
- # Let udev catch up on the attach/detach/change-fd before
- # handing control back, so it doesn't leave a backlog for
- # whatever test runs next.
- udevadm settle
-
- echo "Test complete"
-}
diff --git a/tests/loop/006.out b/tests/loop/006.out
deleted file mode 100644
index 50bf833..0000000
--- a/tests/loop/006.out
+++ /dev/null
@@ -1,2 +0,0 @@
-Running loop/006
-Test complete
--
2.54.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH blktests] loop: remove loop/006 which tests swapping loop fds
2026-10-20 5:41 [PATCH blktests] loop: remove loop/006 which tests swapping loop fds Shin'ichiro Kawasaki
@ 2026-10-28 12:22 ` Shin'ichiro Kawasaki
0 siblings, 0 replies; 2+ messages in thread
From: Shin'ichiro Kawasaki @ 2026-10-28 12:22 UTC (permalink / raw)
To: Shin'ichiro Kawasaki; +Cc: linux-block, Jan Kara, Christian Brauner
On Oct 20, 2026 / 14:41, Shin'ichiro Kawasaki wrote:
> From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
>
> The loop driver is going to drop the support of swapping loop fds. The
> commit titled "loop: remove support for swapping loop fds" is going to
> be applied to kernel version v7.4-rc1, and LOOP_CHANGE_FD ioctl is going
> to be removed.
>
> The test case loop/006 checks the behavior of the swapping loop fds.
> Failure of the test case is expected after the kernel commit. The test
> case no longer has value. Hence remove it.
>
> Link: https://lore.kernel.org/linux-block/as8-8rDJmUb1FxbP@shinmob/
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
FYI, I applied the patch.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-28 12:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-20 5:41 [PATCH blktests] loop: remove loop/006 which tests swapping loop fds Shin'ichiro Kawasaki
2026-10-28 12:22 ` Shin'ichiro Kawasaki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.