fs/splice: ignore flag SPLICE_F_GIFT in syscall vmsplice
Subsystems (3)
PATCH v2 1/1 fs/splice: ignore flag SPLICE_F_GIFT in syscall vmsplice
Generic support of flag SPLICE_F_MOVE in syscall splice was removed in kernel 2.6.21 commit 485ddb4b9741 ("1/2 splice: dont steal"). Infrastructure stay intact and this feature may came back. At least driver or filesystem could provide own implementation.
But stealing mapped pages from userspace never worked and is very unlikely that will ever make sense due to unmapping overhead. Also lru handling is broken if gifted anon page spliced into file.
Let's seal entry point for marking page as a gift in vmsplice.
v2: remove PIPE_BUF_FLAG_GIFT and related dead code.
Signed-off-by Konstantin Khlebnikov <[email protected]>
--- fs/fuse/dev.c | 1 - fs/splice.c | 41 +++-------------------------------------- include/linux/pipe_fs_i.h | 1 - 3 files changed, 3 insertions(+), 40 deletions(-)
fs/fuse/dev.c +0 -1
@@ -1987,7 +1987,6 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe, goto out_free; *obuf = *ibuf; - obuf->flags &= ~PIPE_BUF_FLAG_GIFT ; obuf->len = rem; ibuf->offset += obuf->len; ibuf->len -= obuf->len;
fs/splice.c +3 -38
79 lines not on this page · raw message
include/linux/pipe_fs_i.h +0 -1
@@ -6,7 +6,6 @@#define PIPE_BUF_FLAG_LRU 0x01/* page is on the LRU */ #define PIPE_BUF_FLAG_ATOMIC 0x02/* was atomically mapped */ -#define PIPE_BUF_FLAG_GIFT 0x04/* page is a gift */ #define PIPE_BUF_FLAG_PACKET 0x08/* read() as a packet */ /**
Looks good,
Reviewed-by Christoph Hellwig <[email protected]>