]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: fix sync options between context and fs structs
authorKarel Zak <kzak@redhat.com>
Thu, 22 Jun 2023 11:11:57 +0000 (13:11 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 22 Jun 2023 11:11:57 +0000 (13:11 +0200)
commit7b37d5b5667103beac16f7ae3cca5feaf00a21b0
tree24ec786adf9defc69902e3044b4d758dc13a41fd
parentab7fe95ad7495adac41a4d79f4771c1b4cbe1fc0
libmount: fix sync options between context and fs structs

Since v2.39 libmount prefers "struct libmnt_optlist" to keep mount options
rather than the original "struct libmnt_fs". This is problem if the
"fs" struct is defined and maintained outside the context.

The library has already a way how to sync "fs" and "optlist", but this
needs to be improved and used more widely. Changes:

* force "fs" from context to always read options from "optlist"

* copy options from "fs" to "optlist" in mnt_context_set_fs()

* internally redirect mnt_fs_* API for options to "optlist" if optlist
  defined

* add simple test to make sure options from different sources are
  always merged together

Addresses: https://github.com/util-linux/util-linux/issues/2326
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c
libmount/src/fs.c