Skip to contentSkip to conversation

ioctl09: Use proper device for partitioning

PATCH In review Jan Kara 3 participants 3 messages Aug 29, 2025

lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/1 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.

---
 testcases/kernel/syscalls/ioctl/ioctl09.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/ioctl/ioctl09.c +1 -1
index 4e61f3bc9ba6..f363b8d01ff5 100644
@@ -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",
Signature · 5 lines
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Hi Jan,

thanks for your fix, merged!

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp