summaryrefslogtreecommitdiffstats
path: root/shlibs/mount/src/context_umount.c
diff options
context:
space:
mode:
authorKarel Zak2011-02-07 15:17:07 +0100
committerKarel Zak2011-02-07 15:17:07 +0100
commit309139c7dc3d7860ee2d5bf23afcf7b9816b4947 (patch)
tree46c9ca21197031c9d0095420eb6056efc1ef1fc5 /shlibs/mount/src/context_umount.c
parentlibmount: don't prepare update if syscall failed (diff)
downloadkernel-qcow2-util-linux-309139c7dc3d7860ee2d5bf23afcf7b9816b4947.tar.gz
kernel-qcow2-util-linux-309139c7dc3d7860ee2d5bf23afcf7b9816b4947.tar.xz
kernel-qcow2-util-linux-309139c7dc3d7860ee2d5bf23afcf7b9816b4947.zip
libmount: add and copy FS internal flags
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/context_umount.c')
-rw-r--r--shlibs/mount/src/context_umount.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/shlibs/mount/src/context_umount.c b/shlibs/mount/src/context_umount.c
index 122ef7f84..bd9be6956 100644
--- a/shlibs/mount/src/context_umount.c
+++ b/shlibs/mount/src/context_umount.c
@@ -25,7 +25,7 @@ static int lookup_umount_fs(struct libmnt_context *cxt)
{
int rc;
const char *tgt;
- struct libmnt_table *mtab;
+ struct libmnt_table *mtab = NULL;
struct libmnt_fs *fs;
assert(cxt);
@@ -69,30 +69,19 @@ static int lookup_umount_fs(struct libmnt_context *cxt)
}
if (!fs) {
- DBG(CXT, mnt_debug_h(cxt, "cannot found %s in mtab", tgt));
+ DBG(CXT, mnt_debug_h(cxt, "umount: cannot found %s in mtab", tgt));
return 0;
}
/* copy from mtab to our FS description
*/
- rc = mnt_fs_set_source(cxt->fs, mnt_fs_get_source(fs));
- if (!rc)
- rc = mnt_fs_set_target(cxt->fs, mnt_fs_get_target(fs));
-
- if (!rc && !mnt_fs_get_fstype(cxt->fs))
- rc = mnt_fs_set_fstype(cxt->fs, mnt_fs_get_fstype(fs));
-
- if (!rc)
- rc = mnt_fs_set_vfs_options(cxt->fs, mnt_fs_get_vfs_options(fs));
- if (!rc)
- rc = mnt_fs_set_fs_options(cxt->fs, mnt_fs_get_fs_options(fs));
- if (!rc)
- rc = mnt_fs_set_user_options(cxt->fs, mnt_fs_get_user_options(fs));
- if (!rc)
- rc = mnt_fs_set_attributes(cxt->fs, mnt_fs_get_attributes(fs));
+ mnt_fs_set_source(cxt->fs, NULL);
+ mnt_fs_set_target(cxt->fs, NULL);
- if (!rc && mnt_fs_get_bindsrc(fs))
- rc = mnt_fs_set_bindsrc(cxt->fs, mnt_fs_get_bindsrc(fs));
+ if (!mnt_copy_fs(cxt->fs, fs)) {
+ DBG(CXT, mnt_debug_h(cxt, "umount: failed to copy FS"));
+ return -errno;
+ }
DBG(CXT, mnt_debug_h(cxt, "umount: mtab applied"));
cxt->flags |= MNT_FL_TAB_APPLIED;