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:
@ -18,6 +18,9 @@ endif
|
||||
ifeq ($(BUILD_MODULE),none)
|
||||
BUILD_MODULE=$(shell if [ ${LINUX_VERSION_CODE} -ge 263680 -a ${LINUX_VERSION_CODE} -lt 263936 ]; then echo "linux-4.6.7"; else echo "none"; fi)
|
||||
endif
|
||||
ifeq ($(BUILD_MODULE),none)
|
||||
BUILD_MODULE=$(shell if [ ${LINUX_VERSION_CODE} -ge 266752 ]; then echo "linux-4.18.14"; else echo "none"; fi)
|
||||
endif
|
||||
endif
|
||||
ifeq ($(BUILD_MODULE_TMP),rhel)
|
||||
ifeq ($(BUILD_MODULE),none)
|
||||
@ -33,13 +36,14 @@ endif
|
||||
|
||||
modules:
|
||||
ifneq ($(BUILD_MODULE),none)
|
||||
+@(cd $(BUILD_MODULE); make modules)
|
||||
+@(cd $(BUILD_MODULE) && make modules)
|
||||
endif
|
||||
|
||||
clean:
|
||||
@(cd linux-3.10.0-327.36.1.el7; make clean)
|
||||
@(cd linux-4.0.9; make clean)
|
||||
@(cd linux-4.6.7; make clean)
|
||||
@(cd linux-3.10.0-327.36.1.el7 && make clean)
|
||||
@(cd linux-4.0.9 && make clean)
|
||||
@(cd linux-4.6.7 && make clean)
|
||||
@(cd linux-4.18.14 && make clean)
|
||||
|
||||
install:
|
||||
ifneq ($(BUILD_MODULE),none)
|
||||
|
||||
@ -100,6 +100,9 @@ retry:
|
||||
size = vfs_getxattr(old, name, NULL, 0);
|
||||
|
||||
if (size < 0) {
|
||||
/* NOFSCHECK */
|
||||
continue;
|
||||
|
||||
error = size;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -22,6 +22,9 @@ int ovl_setattr(struct dentry *dentry, struct iattr *attr)
|
||||
struct dentry *upperdentry;
|
||||
const struct cred *old_cred;
|
||||
|
||||
/* NOCOPYUPW */
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Check for permissions before trying to copy-up. This is redundant
|
||||
* since it will be rechecked later by ->setattr() on upper dentry. But
|
||||
@ -277,6 +280,9 @@ int ovl_xattr_set(struct dentry *dentry, struct inode *inode, const char *name,
|
||||
struct dentry *realdentry = upperdentry ?: ovl_dentry_lower(dentry);
|
||||
const struct cred *old_cred;
|
||||
|
||||
/* NOCOPYUPW */
|
||||
return 0;
|
||||
|
||||
err = ovl_want_write(dentry);
|
||||
if (err)
|
||||
goto out;
|
||||
@ -405,6 +411,9 @@ int ovl_open_maybe_copy_up(struct dentry *dentry, unsigned int file_flags)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
/* NOCOPYUPW */
|
||||
return err;
|
||||
|
||||
if (ovl_open_need_copy_up(dentry, file_flags)) {
|
||||
err = ovl_want_write(dentry);
|
||||
if (!err) {
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -115,6 +115,8 @@ bool ovl_dentry_remote(struct dentry *dentry)
|
||||
|
||||
bool ovl_dentry_weird(struct dentry *dentry)
|
||||
{
|
||||
/* NOFSCHECK */
|
||||
return false;
|
||||
return dentry->d_flags & (DCACHE_NEED_AUTOMOUNT |
|
||||
DCACHE_MANAGE_TRANSIT |
|
||||
DCACHE_OP_HASH |
|
||||
|
||||
Reference in New Issue
Block a user