Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96159
b: refs/heads/master
c: 7f3d4ee
h: refs/heads/master
i:
  96157: 6309bd1
  96155: 1793727
  96151: 7df974a
  96143: 67ddf56
  96127: be75440
v: v3
  • Loading branch information
Miklos Szeredi authored and Jens Axboe committed May 7, 2008
1 parent cf28872 commit 16f6fd8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 07416d29bcf608257f1e5280642dcbe0021518a3
refs/heads/master: 7f3d4ee108c184ab215036051087aaaaa8de7661
29 changes: 13 additions & 16 deletions trunk/fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,24 +811,19 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
{
struct address_space *mapping = out->f_mapping;
struct inode *inode = mapping->host;
int killsuid, killpriv;
struct splice_desc sd = {
.total_len = len,
.flags = flags,
.pos = *ppos,
.u.file = out,
};
ssize_t ret;
int err = 0;

killpriv = security_inode_need_killpriv(out->f_path.dentry);
killsuid = should_remove_suid(out->f_path.dentry);
if (unlikely(killsuid || killpriv)) {
mutex_lock(&inode->i_mutex);
if (killpriv)
err = security_inode_killpriv(out->f_path.dentry);
if (!err && killsuid)
err = __remove_suid(out->f_path.dentry, killsuid);
mutex_unlock(&inode->i_mutex);
if (err)
return err;
}

ret = splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file);
inode_double_lock(inode, pipe->inode);
ret = remove_suid(out->f_path.dentry);
if (likely(!ret))
ret = __splice_from_pipe(pipe, &sd, pipe_to_file);
inode_double_unlock(inode, pipe->inode);
if (ret > 0) {
unsigned long nr_pages;

Expand All @@ -840,6 +835,8 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
* sync it.
*/
if (unlikely((out->f_flags & O_SYNC) || IS_SYNC(inode))) {
int err;

mutex_lock(&inode->i_mutex);
err = generic_osync_inode(inode, mapping,
OSYNC_METADATA|OSYNC_DATA);
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,6 @@ extern void iget_failed(struct inode *);
extern void clear_inode(struct inode *);
extern void destroy_inode(struct inode *);
extern struct inode *new_inode(struct super_block *);
extern int __remove_suid(struct dentry *, int);
extern int should_remove_suid(struct dentry *);
extern int remove_suid(struct dentry *);

Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ int should_remove_suid(struct dentry *dentry)
}
EXPORT_SYMBOL(should_remove_suid);

int __remove_suid(struct dentry *dentry, int kill)
static int __remove_suid(struct dentry *dentry, int kill)
{
struct iattr newattrs;

Expand Down

0 comments on commit 16f6fd8

Please sign in to comment.