mcoverlayfs: update and compile new overlayfs for 4.18 kernels
This newer version is much simpler than the old ones: - the options are noop, this lets the code simplify all the allocating of a new option struct and passing it around - ovl_reset_ovl_entry was added and called all the time, but the mechanism that made this required is gone in this kernel version On the other hand, one new thing in this version: - newer kernel check the stacking depth of filesystems now, and we are reaching the default limit of two with our setup. Bump it to three here. Also, while we are here, make make fail if requested directory does not exist, instead of infinitely recurse into make modules in the mcoverlayfs directory... Change-Id: I45050d693a0aa6fd3027deaf417c29876ef6a1ea
This commit is contained in:
@ -24,6 +24,7 @@ MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>");
|
||||
MODULE_DESCRIPTION("Overlay filesystem");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
#define MCOVERLAYFS_SUPER_MAGIC 0x4d634f56
|
||||
|
||||
struct ovl_dir_cache;
|
||||
|
||||
@ -315,7 +316,7 @@ static int ovl_statfs(struct dentry *dentry, struct kstatfs *buf)
|
||||
err = vfs_statfs(&path, buf);
|
||||
if (!err) {
|
||||
buf->f_namelen = ofs->namelen;
|
||||
buf->f_type = OVERLAYFS_SUPER_MAGIC;
|
||||
buf->f_type = MCOVERLAYFS_SUPER_MAGIC;
|
||||
}
|
||||
|
||||
return err;
|
||||
@ -413,6 +414,8 @@ enum {
|
||||
OPT_XINO_ON,
|
||||
OPT_XINO_OFF,
|
||||
OPT_XINO_AUTO,
|
||||
OPT_NOCOPYUPW,
|
||||
OPT_NOFSCHECK,
|
||||
OPT_ERR,
|
||||
};
|
||||
|
||||
@ -429,6 +432,8 @@ static const match_table_t ovl_tokens = {
|
||||
{OPT_XINO_ON, "xino=on"},
|
||||
{OPT_XINO_OFF, "xino=off"},
|
||||
{OPT_XINO_AUTO, "xino=auto"},
|
||||
{OPT_NOCOPYUPW, "nocopyupw"},
|
||||
{OPT_NOFSCHECK, "nofscheck"},
|
||||
{OPT_ERR, NULL}
|
||||
};
|
||||
|
||||
@ -555,6 +560,11 @@ static int ovl_parse_opt(char *opt, struct ovl_config *config)
|
||||
config->xino = OVL_XINO_AUTO;
|
||||
break;
|
||||
|
||||
case OPT_NOCOPYUPW:
|
||||
case OPT_NOFSCHECK:
|
||||
/* compat */
|
||||
break;
|
||||
|
||||
default:
|
||||
pr_err("overlayfs: unrecognized mount option \"%s\" or missing value\n", p);
|
||||
return -EINVAL;
|
||||
@ -1319,7 +1329,7 @@ static struct ovl_entry *ovl_get_lowerstack(struct super_block *sb,
|
||||
|
||||
err = -EINVAL;
|
||||
sb->s_stack_depth++;
|
||||
if (sb->s_stack_depth > FILESYSTEM_MAX_STACK_DEPTH) {
|
||||
if (sb->s_stack_depth > /* NOFSCHECK */ 3) {
|
||||
pr_err("overlayfs: maximum fs stacking depth exceeded\n");
|
||||
goto out_err;
|
||||
}
|
||||
@ -1453,7 +1463,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
|
||||
/* Never override disk quota limits or use reserved space */
|
||||
cap_lower(cred->cap_effective, CAP_SYS_RESOURCE);
|
||||
|
||||
sb->s_magic = OVERLAYFS_SUPER_MAGIC;
|
||||
sb->s_magic = MCOVERLAYFS_SUPER_MAGIC;
|
||||
sb->s_op = &ovl_super_operations;
|
||||
sb->s_xattr = ovl_xattr_handlers;
|
||||
sb->s_fs_info = ofs;
|
||||
@ -1501,11 +1511,11 @@ static struct dentry *ovl_mount(struct file_system_type *fs_type, int flags,
|
||||
|
||||
static struct file_system_type ovl_fs_type = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "overlay",
|
||||
.name = "mcoverlay",
|
||||
.mount = ovl_mount,
|
||||
.kill_sb = kill_anon_super,
|
||||
};
|
||||
MODULE_ALIAS_FS("overlay");
|
||||
MODULE_ALIAS_FS("mcoverlay");
|
||||
|
||||
static void ovl_inode_init_once(void *foo)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user