Commit 6a6ca57de92fcae34603551ac944aa74758c30d4
1 parent
b4ca761577
Exists in
master
and in
20 other branches
pipe: adjust minimum pipe size to 1 page
We don't need to pages to guarantee the POSIX requirement that upto a page size write must be atomic to an empty pipe. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Showing 1 changed file with 1 additions and 7 deletions Side-by-side Diff
fs/pipe.c
... | ... | @@ -1181,13 +1181,7 @@ |
1181 | 1181 | if (!capable(CAP_SYS_ADMIN) && nr_pages > pipe_max_pages) { |
1182 | 1182 | ret = -EPERM; |
1183 | 1183 | goto out; |
1184 | - } | |
1185 | - | |
1186 | - /* | |
1187 | - * The pipe needs to be at least 2 pages large to | |
1188 | - * guarantee POSIX behaviour. | |
1189 | - */ | |
1190 | - if (arg < 2) { | |
1184 | + } else if (nr_pages < 1) { | |
1191 | 1185 | ret = -EINVAL; |
1192 | 1186 | goto out; |
1193 | 1187 | } |