Commit 0fef948
committed
io_uring: make offset == -1 consistent with preadv2/pwritev2
The man page for io_uring generally claims were consistent with what
preadv2 and pwritev2 accept, but turns out there's a slight discrepancy
in how offset == -1 is handled for pipes/streams. preadv doesn't allow
it, but preadv2 does. This currently causes io_uring to return -EINVAL
if that is attempted, but we should allow that as documented.
This change makes us consistent with preadv2/pwritev2 for just passing
in a NULL ppos for streams if the offset is -1.
Cc: stable@vger.kernel.org # v5.7+
Reported-by: Benedikt Ames <wisp3rwind@posteo.eu>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 00d23d5 commit 0fef948
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2866 | 2866 | | |
2867 | 2867 | | |
2868 | 2868 | | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
2869 | 2874 | | |
2870 | 2875 | | |
2871 | 2876 | | |
| |||
2901 | 2906 | | |
2902 | 2907 | | |
2903 | 2908 | | |
2904 | | - | |
| 2909 | + | |
2905 | 2910 | | |
2906 | 2911 | | |
2907 | | - | |
| 2912 | + | |
2908 | 2913 | | |
2909 | 2914 | | |
2910 | 2915 | | |
| |||
3139 | 3144 | | |
3140 | 3145 | | |
3141 | 3146 | | |
3142 | | - | |
| 3147 | + | |
3143 | 3148 | | |
3144 | 3149 | | |
3145 | 3150 | | |
| |||
3262 | 3267 | | |
3263 | 3268 | | |
3264 | 3269 | | |
3265 | | - | |
| 3270 | + | |
3266 | 3271 | | |
3267 | 3272 | | |
3268 | 3273 | | |
| |||
0 commit comments