Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6eaf2f47 authored by Amit Pundir's avatar Amit Pundir
Browse files

ANDROID: vfs: Fix permission2



Fix permission2 breakage introduced by upstream commit
af7bd4dc ("vfs: create vfs helper vfs_tmpfile()") changes.

Fixes: Change-Id: I9d416e3b8b6eca84ef3e336bd2af89ddd51df6ca
       ("ANDROID: vfs: Add permission2 for filesystems with per mount permissions")
Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
parent 5b10242b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3428,7 +3428,7 @@ static int do_last(struct nameidata *nd,
	return error;
}

struct dentry *vfs_tmpfile(struct dentry *dentry, umode_t mode, int open_flag)
struct dentry *vfs_tmpfile(struct vfsmount *mnt, struct dentry *dentry, umode_t mode, int open_flag)
{
	struct dentry *child = NULL;
	struct inode *dir = dentry->d_inode;
@@ -3436,7 +3436,7 @@ struct dentry *vfs_tmpfile(struct dentry *dentry, umode_t mode, int open_flag)
	int error;

	/* we want directory to be writable */
	error = inode_permission2(nd->path.mnt, dir, MAY_WRITE | MAY_EXEC);
	error = inode_permission2(mnt, dir, MAY_WRITE | MAY_EXEC);
	if (error)
		goto out_err;
	error = -EOPNOTSUPP;
@@ -3478,7 +3478,7 @@ static int do_tmpfile(struct nameidata *nd, unsigned flags,
	error = mnt_want_write(path.mnt);
	if (unlikely(error))
		goto out;
	child = vfs_tmpfile(path.dentry, op->mode, op->open_flag);
	child = vfs_tmpfile(path.mnt, path.dentry, op->mode, op->open_flag);
	error = PTR_ERR(child);
	if (unlikely(IS_ERR(child)))
		goto out2;
+1 −1
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ static inline int ovl_do_whiteout(struct inode *dir, struct dentry *dentry)

static inline struct dentry *ovl_do_tmpfile(struct dentry *dentry, umode_t mode)
{
	struct dentry *ret = vfs_tmpfile(dentry, mode, 0);
	struct dentry *ret = vfs_tmpfile(NULL, dentry, mode, 0);
	int err = IS_ERR(ret) ? PTR_ERR(ret) : 0;

	pr_debug("tmpfile(%pd2, 0%o) = %i\n", dentry, mode, err);
+2 −1
Original line number Diff line number Diff line
@@ -1584,7 +1584,8 @@ extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct de
extern int vfs_rename2(struct vfsmount *, struct inode *, struct dentry *, struct inode *, struct dentry *, struct inode **, unsigned int);
extern int vfs_whiteout(struct inode *, struct dentry *);

extern struct dentry *vfs_tmpfile(struct dentry *dentry, umode_t mode,
extern struct dentry *vfs_tmpfile(struct vfsmount *mnt,
				  struct dentry *dentry, umode_t mode,
				  int open_flag);

/*