cxt->mountdata = NULL;
cxt->flags = MNT_FL_DEFAULT;
cxt->noautofs = 1;
+ cxt->has_selinux_opt = 0;
cxt->map_linux = mnt_get_builtin_optmap(MNT_LINUX_MAP);
cxt->map_userspace = mnt_get_builtin_optmap(MNT_USERSPACE_MAP);
n->table_fltrcb_data = o->table_fltrcb_data;
n->noautofs = o->noautofs;
+ n->has_selinux_opt = o->has_selinux_opt;
return n;
failed:
struct libmnt_opt *opt;
int rc;
- DBG(HOOK, ul_debugobj(hs, " configure FS"));
+ DBG(HOOK, ul_debugobj(hs, " config FS"));
ol = mnt_context_get_optlist(cxt);
if (!ol)
return -errno;
}
+ DBG(HOOK, ul_debugobj(hs, " config done [rc=0]"));
return 0;
}
if (!src)
return -EINVAL;
- DBG(HOOK, ul_debugobj(hs, "create FS instance"));
+ DBG(HOOK, ul_debugobj(hs, "init FS"));
rc = fsconfig(api->fd_fs, FSCONFIG_SET_STRING, "source", src, 0);
set_syscall_status(cxt, "fsconfig", rc == 0);
if (!rc)
rc = configure_superblock(cxt, hs, api->fd_fs);
if (!rc) {
+ DBG(HOOK, ul_debugobj(hs, "create FS"));
rc = fsconfig(api->fd_fs, FSCONFIG_CMD_CREATE, NULL, NULL, 0);
set_syscall_status(cxt, "fsconfig", rc == 0);
}
assert(cxt);
assert(hs == &hookset_mount);
+ /*
+ * The current kernel btrfs driver does not completely implement
+ * fsconfig() as it does not work with selinux stuff.
+ *
+ * Don't use the new mount API in this situation. Let's hope this issue
+ * is temporary.
+ */
+ {
+ const char *type = mnt_fs_get_fstype(cxt->fs);
+
+ if (type && strcmp(type, "btrfs") == 0 && cxt->has_selinux_opt) {
+ DBG(HOOK, ul_debugobj(hs, "don't use new API (btrfs issue)"));
+ return 0;
+ }
+ }
+
DBG(HOOK, ul_debugobj(hs, "prepare mount"));
ol = mnt_context_get_optlist(cxt);