Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/3] tst_device: add support for overlayfs
@ 2025-02-03 22:05 Jeff Moyer
  2025-02-03 22:05 ` [LTP] [PATCH 1/3] lib/tst_device.c: factor out btrfs-specific logic from tst_find_backing_dev Jeff Moyer
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Jeff Moyer @ 2025-02-03 22:05 UTC (permalink / raw)
  To: ltp

When running ltp-aiodio on an overlay file system, the following error
occurs:

tst_tmpdir.c:316: TINFO: Using /mnt/fstests/TEST_DIR/ovl-mnt/ltp-hSHEHy5M0s/LTP_aio4q4GMW as tmpdir (overlayfs filesystem)
tst_test.c:1888: TINFO: LTP version: 20220121-2271-g91a10df22
tst_test.c:1892: TINFO: Tested kernel: vendor kernel
tst_test.c:1723: TINFO: Timeout per run is 0h 40m 00s
aiocp.c:211: TINFO: Maximum AIO blocks: 65536
tst_device.c:551: TINFO: Use BTRFS specific strategy
tst_device.c:569: TBROK: BTRFS ioctl failed. Is . on a tmpfs?: ENOTTY (25)

The issue is that stat(2) on an overlayfs mount point will return a
major device number of 0.  The code assumes this is btrfs, and tries
to issue a btrfs-specific ioctl.  When that fails, the final message is
printed that suggests this might be tmpfs.

I modified the code to use statfs(2) to get the file system type, and
use that to determine which file system specific code to call.  Finally, I
added code to parse out the upper directory from the overlayfs mount options
using libmount.  libmount is part of util-linux, so it should be fairly
ubiquitous.  stat(2) is then called on the upper directory to get to the
underlying device node.

Review of the series is greatly appreciated.

Thanks in advance!
Jeff

[PATCH 1/3] lib/tst_device.c: factor out btrfs-specific logic from
[PATCH 2/3] lib/tst_device.c: check for BTRFS_SUPER_MAGIC instead of
[PATCH 3/3] lib/tst_device.c: add support for overlayfs


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-02-07 17:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-03 22:05 [LTP] [PATCH 0/3] tst_device: add support for overlayfs Jeff Moyer
2025-02-03 22:05 ` [LTP] [PATCH 1/3] lib/tst_device.c: factor out btrfs-specific logic from tst_find_backing_dev Jeff Moyer
2025-02-03 22:05 ` [LTP] [PATCH 2/3] lib/tst_device.c: check for BTRFS_SUPER_MAGIC instead of device major of 0 Jeff Moyer
2025-02-03 22:06 ` [LTP] [PATCH 3/3] lib/tst_device.c: add support for overlayfs Jeff Moyer
2025-02-07 11:23   ` Petr Vorel
2025-02-07 11:37 ` [LTP] [PATCH 0/3] tst_device: " Petr Vorel
2025-02-07 12:38   ` Cyril Hrubis
2025-02-07 15:28     ` Jeff Moyer
2025-02-07 15:27   ` Jeff Moyer
2025-02-07 17:08   ` Jeff Moyer
2025-02-07 17:15     ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox