summaryrefslogtreecommitdiffstats
path: root/shlibs
diff options
context:
space:
mode:
authorKarel Zak2010-12-15 15:06:42 +0100
committerKarel Zak2011-01-03 12:28:47 +0100
commit87a07a4cc8592a937006c5cdb93739b185bdbd7c (patch)
tree01e8588ef6362005ac8ba8de97c7a8124ec5b766 /shlibs
parentfindmnt: use new libmount functions (diff)
downloadkernel-qcow2-util-linux-87a07a4cc8592a937006c5cdb93739b185bdbd7c.tar.gz
kernel-qcow2-util-linux-87a07a4cc8592a937006c5cdb93739b185bdbd7c.tar.xz
kernel-qcow2-util-linux-87a07a4cc8592a937006c5cdb93739b185bdbd7c.zip
libmount: minor fixes
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs')
-rw-r--r--shlibs/mount/src/Makefile.am2
-rw-r--r--shlibs/mount/src/context.c3
-rw-r--r--shlibs/mount/src/context_mount.c3
-rw-r--r--shlibs/mount/src/fs.c2
-rw-r--r--shlibs/mount/src/tab_update.c5
5 files changed, 10 insertions, 5 deletions
diff --git a/shlibs/mount/src/Makefile.am b/shlibs/mount/src/Makefile.am
index 261effa13..6c241ba2d 100644
--- a/shlibs/mount/src/Makefile.am
+++ b/shlibs/mount/src/Makefile.am
@@ -55,7 +55,7 @@ uninstall-hook:
tests = test_version test_cache test_optstr test_lock \
- test_tab test_utils test_tab_update
+ test_tab test_utils test_tab_update test_context
tests: all $(tests)
test_%: %.c all
diff --git a/shlibs/mount/src/context.c b/shlibs/mount/src/context.c
index 59e8bd920..679152052 100644
--- a/shlibs/mount/src/context.c
+++ b/shlibs/mount/src/context.c
@@ -1049,6 +1049,9 @@ int mnt_context_merge_mountflags(mnt_context *cxt)
return rc;
cxt->user_mountflags = fl;
+ DBG(CXT, mnt_debug_h(cxt, "final flags: VFS=%08lx userspace=%08lx",
+ cxt->mountflags, cxt->user_mountflags));
+
cxt->flags |= MNT_FL_MOUNTFLAGS_MERGED;
return 0;
}
diff --git a/shlibs/mount/src/context_mount.c b/shlibs/mount/src/context_mount.c
index b5a339f5f..b66b060e2 100644
--- a/shlibs/mount/src/context_mount.c
+++ b/shlibs/mount/src/context_mount.c
@@ -48,9 +48,6 @@ static int fix_optstr(mnt_context *cxt)
fs = cxt->fs;
- if (!mnt_fs_get_vfs_options(fs) && !mnt_fs_get_userspace_options(fs))
- return 0;
-
/* The propagation flags should not be used together with any other flags */
if (cxt->mountflags & MS_PROPAGATION)
cxt->mountflags &= MS_PROPAGATION;
diff --git a/shlibs/mount/src/fs.c b/shlibs/mount/src/fs.c
index b8e9085d1..61bad7fd7 100644
--- a/shlibs/mount/src/fs.c
+++ b/shlibs/mount/src/fs.c
@@ -478,7 +478,7 @@ char *mnt_fs_strdup_options(mnt_fs *fs)
errno = 0;
res = merge_optstr(fs->vfs_optstr, fs->fs_optstr);
- if (errno)
+ if (!res && errno)
return NULL;
if (fs->user_optstr) {
if (mnt_optstr_append_option(&res, fs->user_optstr, NULL)) {
diff --git a/shlibs/mount/src/tab_update.c b/shlibs/mount/src/tab_update.c
index ad7c19d74..e474e514d 100644
--- a/shlibs/mount/src/tab_update.c
+++ b/shlibs/mount/src/tab_update.c
@@ -151,6 +151,10 @@ int mnt_update_set_fs(mnt_update *upd, int mountflags,
DBG(UPDATE, mnt_debug_h(upd,
"reseting FS [fs=0x%p, target=%s, flags=0x%08x]",
fs, target, mountflags));
+ if (fs) {
+ DBG(UPDATE, mnt_debug_h(upd, "FS template:"));
+ DBG(UPDATE, mnt_fs_print_debug(fs, stderr));
+ }
mnt_free_fs(upd->fs);
free(upd->target);
@@ -683,6 +687,7 @@ int mnt_update_tab(mnt_update *upd, mnt_lock *lc)
return 0;
DBG(UPDATE, mnt_debug_h(upd, "%s: update tab", upd->filename));
+ DBG(UPDATE, mnt_fs_print_debug(upd->fs, stderr));
if (!upd->fs && upd->target)
rc = update_remove_entry(upd, lc); /* umount */