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

Commit 2f1936b8 authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Al Viro
Browse files

[patch 3/5] vfs: change remove_suid() to file_remove_suid()



All calls to remove_suid() are made with a file pointer, because
(similarly to file_update_time) it is called when the file is written.

Clean up callers by passing in a file instead of a dentry.

Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
parent c82e42da
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -893,7 +893,7 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
	if (count == 0)
		goto out;

	err = remove_suid(file->f_path.dentry);
	err = file_remove_suid(file);
	if (err)
		goto out;

+1 −1
Original line number Diff line number Diff line
@@ -2118,7 +2118,7 @@ static ssize_t ntfs_file_aio_write_nolock(struct kiocb *iocb,
		goto out;
	if (!count)
		goto out;
	err = remove_suid(file->f_path.dentry);
	err = file_remove_suid(file);
	if (err)
		goto out;
	file_update_time(file);
+2 −2
Original line number Diff line number Diff line
@@ -772,7 +772,7 @@ generic_file_splice_write_nolock(struct pipe_inode_info *pipe, struct file *out,
	ssize_t ret;
	int err;

	err = remove_suid(out->f_path.dentry);
	err = file_remove_suid(out);
	if (unlikely(err))
		return err;

@@ -830,7 +830,7 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
	ssize_t ret;

	inode_double_lock(inode, pipe->inode);
	ret = remove_suid(out->f_path.dentry);
	ret = file_remove_suid(out);
	if (likely(!ret))
		ret = __splice_from_pipe(pipe, &sd, pipe_to_file);
	inode_double_unlock(inode, pipe->inode);
+1 −1
Original line number Diff line number Diff line
@@ -711,7 +711,7 @@ xfs_write(
	     !capable(CAP_FSETID)) {
		error = xfs_write_clear_setuid(xip);
		if (likely(!error))
			error = -remove_suid(file->f_path.dentry);
			error = -file_remove_suid(file);
		if (unlikely(error)) {
			goto out_unlock_internal;
		}
+1 −1
Original line number Diff line number Diff line
@@ -1834,7 +1834,7 @@ extern void clear_inode(struct inode *);
extern void destroy_inode(struct inode *);
extern struct inode *new_inode(struct super_block *);
extern int should_remove_suid(struct dentry *);
extern int remove_suid(struct dentry *);
extern int file_remove_suid(struct file *);

extern void __insert_inode_hash(struct inode *, unsigned long hashval);
extern void remove_inode_hash(struct inode *);
Loading