Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199171
b: refs/heads/master
c: cc967be
h: refs/heads/master
i:
  199169: 786a112
  199167: 6c41732
v: v3
  • Loading branch information
Julia Lawall authored and Al Viro committed May 28, 2010
1 parent ce884f1 commit aaa2b4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 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: ea635c64e007061f6468ece5cc9cc62d41d4ecf2
refs/heads/master: cc967be54710d97c05229b2e5ba2d00df84ddd64
13 changes: 9 additions & 4 deletions trunk/fs/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,14 +1169,18 @@ long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg)

switch (cmd) {
case F_SETPIPE_SZ:
if (!capable(CAP_SYS_ADMIN) && arg > pipe_max_pages)
return -EINVAL;
if (!capable(CAP_SYS_ADMIN) && arg > pipe_max_pages) {
ret = -EINVAL;
goto out;
}
/*
* The pipe needs to be at least 2 pages large to
* guarantee POSIX behaviour.
*/
if (arg < 2)
return -EINVAL;
if (arg < 2) {
ret = -EINVAL;
goto out;
}
ret = pipe_set_size(pipe, arg);
break;
case F_GETPIPE_SZ:
Expand All @@ -1187,6 +1191,7 @@ long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg)
break;
}

out:
mutex_unlock(&pipe->inode->i_mutex);
return ret;
}
Expand Down

0 comments on commit aaa2b4a

Please sign in to comment.