Commit 97ef77c
fs: check FMODE_LSEEK to control internal pipe splicing
The original direct splicing mechanism from Jens required the input to
be a regular file because it was avoiding the special socket case. It
also recognized blkdevs as being close enough to a regular file. But it
forgot about chardevs, which behave the same way and work fine here.
This is an okayish heuristic, but it doesn't totally work. For example,
a few chardevs should be spliceable here. And a few regular files
shouldn't. This patch fixes this by instead checking whether FMODE_LSEEK
is set, which represents decently enough what we need rewinding for when
splicing to internal pipes.
Fixes: b92ce55 ("[PATCH] splice: add direct fd <-> fd splicing support")
Cc: Jens Axboe <[email protected]>
Signed-off-by: Jason A. Donenfeld <[email protected]>
Signed-off-by: Al Viro <[email protected]>1 parent 54ef7a4 commit 97ef77c
1 file changed
+4
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
817 | | - | |
818 | 817 | | |
819 | 818 | | |
820 | 819 | | |
821 | 820 | | |
822 | | - | |
823 | | - | |
824 | | - | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
825 | 824 | | |
826 | | - | |
827 | | - | |
| 825 | + | |
828 | 826 | | |
829 | 827 | | |
830 | 828 | | |
| |||
0 commit comments