diff options
author | Karel Zak | 2016-12-09 15:11:31 +0100 |
---|---|---|
committer | Karel Zak | 2016-12-09 15:36:14 +0100 |
commit | 0a14cc8bcc151e03c8979ed1ff4a3bee9672365b (patch) | |
tree | 5f72c2484435b556ddec93bd162e9e5f5dedbd9d /libmount/src/context.c | |
parent | Merge branch doc_fixes (diff) | |
download | kernel-qcow2-util-linux-0a14cc8bcc151e03c8979ed1ff4a3bee9672365b.tar.gz kernel-qcow2-util-linux-0a14cc8bcc151e03c8979ed1ff4a3bee9672365b.tar.xz kernel-qcow2-util-linux-0a14cc8bcc151e03c8979ed1ff4a3bee9672365b.zip |
libmount: revert X-* and x-* meaning
Let's hope this is last change necessary to cleanup x-* usage:
x-* persistent option, stored in utab, available for umount, etc.
X-* fstab comment only
mount(8) supports x-mount.mkdir= as well as newly recommended X-mount.mkdir=
Advantages:
* less invasive
* does not require exception for x-systemd
* does not require rename x-initrd to X-initrd
The systemd and dracut users will get the new (=fixed) functionality without a
change in fstab configuration. This is the primary goal.
Disadvantages:
* not 100% compatible libmount behavior, x-* options have not been
previously stored in utab. The API is the same, options will be still
available, but on x-* libmount will write to /run/mount/utab. For now
it seems only systemd uses x-*, and they like this behavior, so...
Addresses: https://github.com/systemd/systemd/pull/4515
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/context.c')
-rw-r--r-- | libmount/src/context.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libmount/src/context.c b/libmount/src/context.c index 87ccccfc6..44282c07b 100644 --- a/libmount/src/context.c +++ b/libmount/src/context.c @@ -1531,7 +1531,7 @@ int mnt_context_prepare_srcpath(struct libmnt_context *cxt) return 0; } -/* create a mountpoint if x-mount.mkdir[=<mode>] specified */ +/* create a mountpoint if X-mount.mkdir[=<mode>] specified */ static int mkdir_target(const char *tgt, struct libmnt_fs *fs) { char *mstr = NULL; @@ -1543,8 +1543,12 @@ static int mkdir_target(const char *tgt, struct libmnt_fs *fs) assert(tgt); assert(fs); - if (mnt_optstr_get_option(fs->user_optstr, "x-mount.mkdir", &mstr, &mstr_sz) != 0) + if (mnt_optstr_get_option(fs->user_optstr, "X-mount.mkdir", &mstr, &mstr_sz) != 0 && + mnt_optstr_get_option(fs->user_optstr, "x-mount.mkdir", &mstr, &mstr_sz) != 0) /* obsolete */ return 0; + + DBG(CXT, ul_debug("mkdir %s (%s) wanted", tgt, mstr)); + if (mnt_stat_mountpoint(tgt, &st) == 0) return 0; @@ -1591,7 +1595,8 @@ int mnt_context_prepare_target(struct libmnt_context *cxt) /* mkdir target */ if (cxt->action == MNT_ACT_MOUNT && !mnt_context_is_restricted(cxt) - && cxt->user_mountflags & MNT_MS_XCOMMENT) { + && (cxt->user_mountflags & MNT_MS_XCOMMENT || + cxt->user_mountflags & MNT_MS_XFSTABCOMM)) { rc = mkdir_target(tgt, cxt->fs); if (rc) |