[LTP] [PATCH] ioctl09: Use proper device for partitioning
Jan Kara
jack@suse.cz
Fri Aug 29 16:19:32 CEST 2025
The test occasionally fails because loop0p2 partition never gets
created. This happens because the uses parted(8) to modify partitions in
the backing file (test.img) while the loop device with this file as a
backing is already setup. Thus the page cache of loop0 can cache old
version of the partition table which is then used by the partitioning
code. Fix the problem by calling parted against the loop device
directly.
Signed-off-by: Jan Kara <jack@suse.cz>
---
testcases/kernel/syscalls/ioctl/ioctl09.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/ioctl/ioctl09.c b/testcases/kernel/syscalls/ioctl/ioctl09.c
index 4e61f3bc9ba6..f363b8d01ff5 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl09.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl09.c
@@ -64,7 +64,7 @@ static void verify_ioctl(void)
"mklabel", "msdos", "mkpart",
"primary", "ext4", "1M", "10M",
NULL};
- const char *const cmd_parted_new[] = {"parted", "-s", "test.img",
+ const char *const cmd_parted_new[] = {"parted", "-s", dev_path,
"mklabel", "msdos", "mkpart",
"primary", "ext4", "1M", "10M",
"mkpart", "primary", "ext4",
--
2.43.0
More information about the ltp
mailing list