File 0001-ioctl09-Use-proper-device-for-partitioning.patch of Package ltp-stable

From 9f3a158466918f41dadbafef88dbf89c8736dfb2 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Fri, 29 Aug 2025 16:19:32 +0200
Subject: [PATCH] ioctl09: Use proper device for partitioning

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.

Link: https://lore.kernel.org/ltp/20250829141932.31997-1-jack@suse.cz/
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Tested-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
Fixes: bsc#1198108
Upstream: https://github.com/linux-test-project/ltp/commit/f8c7b6c22db90db8e62d59cb869f6d622d45003f
---
 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 4e61f3bc9b..f363b8d01f 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.50.1

openSUSE Build Service is sponsored by