Linux Test Project
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 0/3] tst_device: add support for overlayfs
Date: Fri, 07 Feb 2025 10:27:19 -0500	[thread overview]
Message-ID: <x49h655epwo.fsf@segfault.usersys.redhat.com> (raw)
In-Reply-To: <20250207113726.GB1739723@pevik> (Petr Vorel's message of "Fri, 7 Feb 2025 12:37:26 +0100")

Hi, Petr,

Petr Vorel <pvorel@suse.cz> writes:

> Hi Jeff, all,
>
> NOTE: 'rm -fv lib/libltp.a' is required to apply the patchset.

Right, sorry for not mentioning that.

> Besides it, it does not compile yet:
> /usr/bin/ld: cannot find -lltp: No such file or directory
> https://lore.kernel.org/ltp/20250207112353.GA1739723@pevik/

It compiled for me, so that's surprising.  I would help track it down,
but it sounds like Cyril would prefer we didn't add a dependency.

>
>> 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
>
> We try to avoid external libraries to help testing kernel on some minimal
> embedded devices. @Cyril: is it ok to drag libmount-devel?
>
> @Jeff: would it be too hard to parse /proc/self/mountinfo (I suppose
> /proc/self/mounts is not enough)? I'm looking into libmount code E.e.
> mnt_fs_get_option() [1]. Or do you think it would be too fragile to parse it
> without libmount?

I thought about it, but I typically avoid string parsing whenever
possible.  There are just too many corner cases.  Looking through the
libmount code convinced me I did not want to wade into those waters.  :)
It is, of course, possible to parse it directly.  There may be some
added maintenance burden, but it should be managable.  I'll purue that
route.

Thanks for taking a look!

-Jeff

>
> Kind regards,
> Petr
>
> [1]
> https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/libmount/src/fs.c#n1568
>
>> 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


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

  parent reply	other threads:[~2025-02-07 15:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2025-02-07 17:08   ` Jeff Moyer
2025-02-07 17:15     ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x49h655epwo.fsf@segfault.usersys.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox