Removed irrelevant patch rejections.
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
--- fs/Kconfig
|
||||
+++ fs/Kconfig
|
||||
@@ -67,7 +67,6 @@ source "fs/quota/Kconfig"
|
||||
|
||||
source "fs/autofs4/Kconfig"
|
||||
source "fs/fuse/Kconfig"
|
||||
-source "fs/overlayfs/Kconfig"
|
||||
|
||||
config CUSE
|
||||
tristate "Character device in Userspace support"
|
||||
@@ -1,10 +0,0 @@
|
||||
--- fs/Makefile
|
||||
+++ fs/Makefile
|
||||
@@ -106,7 +106,6 @@ obj-$(CONFIG_QNX6FS_FS) += qnx6/
|
||||
obj-$(CONFIG_AUTOFS4_FS) += autofs4/
|
||||
obj-$(CONFIG_ADFS_FS) += adfs/
|
||||
obj-$(CONFIG_FUSE_FS) += fuse/
|
||||
-obj-$(CONFIG_OVERLAYFS_FS) += overlayfs/
|
||||
obj-$(CONFIG_UDF_FS) += udf/
|
||||
obj-$(CONFIG_SUN_OPENPROMFS) += openpromfs/
|
||||
obj-$(CONFIG_OMFS_FS) += omfs/
|
||||
@@ -1,73 +0,0 @@
|
||||
--- fs/namei.c
|
||||
+++ fs/namei.c
|
||||
@@ -327,36 +327,6 @@ static inline int do_inode_permission(struct inode *inode, int mask)
|
||||
return generic_permission(inode, mask);
|
||||
}
|
||||
|
||||
-/**
|
||||
- * inode_only_permission - check access rights to a given inode only
|
||||
- * @inode: inode to check permissions on
|
||||
- * @mask: right to check for (%MAY_READ, %MAY_WRITE, %MAY_EXEC, ...)
|
||||
- *
|
||||
- * Uses to check read/write/execute permissions on an inode directly, we do
|
||||
- * not check filesystem permissions.
|
||||
- */
|
||||
-int inode_only_permission(struct inode *inode, int mask)
|
||||
-{
|
||||
- int retval;
|
||||
-
|
||||
- /*
|
||||
- * Nobody gets write access to an immutable file.
|
||||
- */
|
||||
- if (unlikely(mask & MAY_WRITE) && IS_IMMUTABLE(inode))
|
||||
- return -EACCES;
|
||||
-
|
||||
- retval = do_inode_permission(inode, mask);
|
||||
- if (retval)
|
||||
- return retval;
|
||||
-
|
||||
- retval = devcgroup_inode_permission(inode, mask);
|
||||
- if (retval)
|
||||
- return retval;
|
||||
-
|
||||
- return security_inode_permission(inode, mask);
|
||||
-}
|
||||
-EXPORT_SYMBOL(inode_only_permission);
|
||||
-
|
||||
/**
|
||||
* inode_permission - check for access rights to a given inode
|
||||
* @inode: inode to check permission on
|
||||
@@ -371,6 +341,8 @@ static inline int do_inode_permission(struct inode *inode, int mask)
|
||||
*/
|
||||
int inode_permission(struct inode *inode, int mask)
|
||||
{
|
||||
+ int retval;
|
||||
+
|
||||
if (unlikely(mask & MAY_WRITE)) {
|
||||
umode_t mode = inode->i_mode;
|
||||
|
||||
@@ -380,9 +352,23 @@ int inode_permission(struct inode *inode, int mask)
|
||||
if (IS_RDONLY(inode) &&
|
||||
(S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
|
||||
return -EROFS;
|
||||
+
|
||||
+ /*
|
||||
+ * Nobody gets write access to an immutable file.
|
||||
+ */
|
||||
+ if (IS_IMMUTABLE(inode))
|
||||
+ return -EACCES;
|
||||
}
|
||||
|
||||
- return inode_only_permission(inode, mask);
|
||||
+ retval = do_inode_permission(inode, mask);
|
||||
+ if (retval)
|
||||
+ return retval;
|
||||
+
|
||||
+ retval = devcgroup_inode_permission(inode, mask);
|
||||
+ if (retval)
|
||||
+ return retval;
|
||||
+
|
||||
+ return security_inode_permission(inode, mask);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1,27 +0,0 @@
|
||||
--- fs/namespace.c
|
||||
+++ fs/namespace.c
|
||||
@@ -1326,24 +1326,6 @@ void drop_collected_mounts(struct vfsmount *mnt)
|
||||
release_mounts(&umount_list);
|
||||
}
|
||||
|
||||
-struct vfsmount *clone_private_mount(struct path *path)
|
||||
-{
|
||||
- struct mount *old_mnt = real_mount(path->mnt);
|
||||
- struct mount *new_mnt;
|
||||
-
|
||||
- if (IS_MNT_UNBINDABLE(old_mnt))
|
||||
- return ERR_PTR(-EINVAL);
|
||||
-
|
||||
- down_read(&namespace_sem);
|
||||
- new_mnt = clone_mnt(old_mnt, path->dentry, CL_PRIVATE);
|
||||
- up_read(&namespace_sem);
|
||||
- if (!new_mnt)
|
||||
- return ERR_PTR(-ENOMEM);
|
||||
-
|
||||
- return &new_mnt->mnt;
|
||||
-}
|
||||
-EXPORT_SYMBOL_GPL(clone_private_mount);
|
||||
-
|
||||
int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
|
||||
struct vfsmount *root)
|
||||
{
|
||||
151
fs/open.c.rej
151
fs/open.c.rej
@@ -1,151 +0,0 @@
|
||||
--- fs/open.c
|
||||
+++ fs/open.c
|
||||
@@ -644,24 +644,24 @@ static inline int __get_file_write_access(struct inode *inode,
|
||||
return error;
|
||||
}
|
||||
|
||||
-static struct file *__dentry_open(struct path *path, struct file *f,
|
||||
- int (*open)(struct inode *, struct file *),
|
||||
- const struct cred *cred)
|
||||
+static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt,
|
||||
+ struct file *f,
|
||||
+ int (*open)(struct inode *, struct file *),
|
||||
+ const struct cred *cred)
|
||||
{
|
||||
static const struct file_operations empty_fops = {};
|
||||
struct inode *inode;
|
||||
int error;
|
||||
|
||||
- path_get(path);
|
||||
f->f_mode = OPEN_FMODE(f->f_flags) | FMODE_LSEEK |
|
||||
FMODE_PREAD | FMODE_PWRITE;
|
||||
|
||||
if (unlikely(f->f_flags & O_PATH))
|
||||
f->f_mode = FMODE_PATH;
|
||||
|
||||
- inode = path->dentry->d_inode;
|
||||
+ inode = dentry->d_inode;
|
||||
if (f->f_mode & FMODE_WRITE) {
|
||||
- error = __get_file_write_access(inode, path->mnt);
|
||||
+ error = __get_file_write_access(inode, mnt);
|
||||
if (error)
|
||||
goto cleanup_file;
|
||||
if (!special_file(inode->i_mode))
|
||||
@@ -669,7 +669,8 @@ static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt,
|
||||
}
|
||||
|
||||
f->f_mapping = inode->i_mapping;
|
||||
- f->f_path = *path;
|
||||
+ f->f_path.dentry = dentry;
|
||||
+ f->f_path.mnt = mnt;
|
||||
f->f_pos = 0;
|
||||
file_sb_list_add(f, inode->i_sb);
|
||||
|
||||
@@ -726,7 +727,7 @@ static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt,
|
||||
* here, so just reset the state.
|
||||
*/
|
||||
file_reset_write(f);
|
||||
- mnt_drop_write(path->mnt);
|
||||
+ mnt_drop_write(mnt);
|
||||
}
|
||||
}
|
||||
file_sb_list_del(f);
|
||||
@@ -734,7 +735,8 @@ static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt,
|
||||
f->f_path.mnt = NULL;
|
||||
cleanup_file:
|
||||
put_filp(f);
|
||||
- path_put(path);
|
||||
+ dput(dentry);
|
||||
+ mntput(mnt);
|
||||
return ERR_PTR(error);
|
||||
}
|
||||
|
||||
@@ -760,14 +762,14 @@ static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt,
|
||||
struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
|
||||
int (*open)(struct inode *, struct file *))
|
||||
{
|
||||
- struct path path = { .dentry = dentry, .mnt = nd->path.mnt };
|
||||
const struct cred *cred = current_cred();
|
||||
|
||||
if (IS_ERR(nd->intent.open.file))
|
||||
goto out;
|
||||
if (IS_ERR(dentry))
|
||||
goto out_err;
|
||||
- nd->intent.open.file = __dentry_open(&path, nd->intent.open.file,
|
||||
+ nd->intent.open.file = __dentry_open(dget(dentry), mntget(nd->path.mnt),
|
||||
+ nd->intent.open.file,
|
||||
open, cred);
|
||||
out:
|
||||
return nd->intent.open.file;
|
||||
@@ -795,9 +797,11 @@ struct file *nameidata_to_filp(struct nameidata *nd)
|
||||
nd->intent.open.file = NULL;
|
||||
|
||||
/* Has the filesystem initialised the file for us? */
|
||||
- if (filp->f_path.dentry == NULL)
|
||||
- filp = vfs_open(&nd->path, filp, cred);
|
||||
-
|
||||
+ if (filp->f_path.dentry == NULL) {
|
||||
+ path_get(&nd->path);
|
||||
+ filp = __dentry_open(nd->path.dentry, nd->path.mnt, filp,
|
||||
+ NULL, cred);
|
||||
+ }
|
||||
return filp;
|
||||
}
|
||||
|
||||
@@ -808,48 +812,27 @@ struct file *nameidata_to_filp(struct nameidata *nd)
|
||||
struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags,
|
||||
const struct cred *cred)
|
||||
{
|
||||
+ int error;
|
||||
struct file *f;
|
||||
- struct file *ret;
|
||||
- struct path path = { .dentry = dentry, .mnt = mnt };
|
||||
|
||||
validate_creds(cred);
|
||||
|
||||
/* We must always pass in a valid mount pointer. */
|
||||
BUG_ON(!mnt);
|
||||
|
||||
- ret = ERR_PTR(-ENFILE);
|
||||
+ error = -ENFILE;
|
||||
f = get_empty_filp();
|
||||
- if (f != NULL) {
|
||||
- f->f_flags = flags;
|
||||
- ret = vfs_open(&path, f, cred);
|
||||
+ if (f == NULL) {
|
||||
+ dput(dentry);
|
||||
+ mntput(mnt);
|
||||
+ return ERR_PTR(error);
|
||||
}
|
||||
- path_put(&path);
|
||||
|
||||
- return ret;
|
||||
+ f->f_flags = flags;
|
||||
+ return __dentry_open(dentry, mnt, f, NULL, cred);
|
||||
}
|
||||
EXPORT_SYMBOL(dentry_open);
|
||||
|
||||
-/**
|
||||
- * vfs_open - open the file at the given path
|
||||
- * @path: path to open
|
||||
- * @filp: newly allocated file with f_flag initialized
|
||||
- * @cred: credentials to use
|
||||
- *
|
||||
- * Open the file. If successful, the returned file will have acquired
|
||||
- * an additional reference for path.
|
||||
- */
|
||||
-struct file *vfs_open(struct path *path, struct file *filp,
|
||||
- const struct cred *cred)
|
||||
-{
|
||||
- struct inode *inode = path->dentry->d_inode;
|
||||
-
|
||||
- if (inode->i_op->open)
|
||||
- return inode->i_op->open(path->dentry, filp, cred);
|
||||
- else
|
||||
- return __dentry_open(path, filp, NULL, cred);
|
||||
-}
|
||||
-EXPORT_SYMBOL(vfs_open);
|
||||
-
|
||||
static void __put_unused_fd(struct files_struct *files, unsigned int fd)
|
||||
{
|
||||
struct fdtable *fdt = files_fdtable(files);
|
||||
@@ -1,10 +0,0 @@
|
||||
--- fs/splice.c
|
||||
+++ fs/splice.c
|
||||
@@ -1305,7 +1305,6 @@ long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
|
||||
|
||||
return ret;
|
||||
}
|
||||
-EXPORT_SYMBOL(do_splice_direct);
|
||||
|
||||
static int splice_pipe_to_pipe(struct pipe_inode_info *ipipe,
|
||||
struct pipe_inode_info *opipe,
|
||||
Reference in New Issue
Block a user