]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: merge utab into listmount-based tables
authorKarel Zak <kzak@redhat.com>
Thu, 25 Jun 2026 12:52:21 +0000 (14:52 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 29 Jun 2026 09:13:18 +0000 (11:13 +0200)
commitb76aaa07851e7745e6d9b2476688dfc47ce7f415
treec795d70caad8fb8ee87d28cd7c67c59fa7674cfe
parente677abc421450b54783e0194597b09ed382cf93d
libmount: merge utab into listmount-based tables

Extract utab merge logic from __mnt_table_parse_mountinfo() into a
shared mnt_table_merge_utab() function and call it at the end of
mnt_table_fetch_listmount(). This makes userspace mount options
(x-systemd.*, user=, etc.) available when the mount table is obtained
via listmount/statmount syscalls.

The merge sets user_optstr directly (instead of the combined optstr)
to avoid conflicts with lazy statmount() which populates kernel
options on demand.

Add mnt_table_disable_useropts() public API to allow callers to skip
utab merging when only kernel-side data is needed.

Use the new API in findmnt --kernel=listmount to keep backward
compatible behavior (kernel-only data); users who want userspace
options can use --mtab.

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit c839a9ac8fed409c332c94ec69ddc11aea97ae80)
libmount/docs/libmount-sections.txt
libmount/src/libmount.h.in
libmount/src/libmount.sym
libmount/src/mountP.h
libmount/src/tab_listmount.c
libmount/src/tab_parse.c
misc-utils/findmnt.c