Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote: > > 13/44: splice: stop abusing iov_iter_advance() to flush a pipe > A really odd (ab)use of iov_iter_advance() - in case of error > generic_file_splice_read() wants to free all pipe buffers ->read_iter() > has produced. Yes, forcibly resetting ->head and ->iov_offset to > original values and calling iov_iter_advance(i, 0) will trigger > pipe_advance(), which will trigger pipe_truncate(), which will free > buffers. Or we could just go ahead and free the same buffers; > pipe_discard_from() does exactly that, no iov_iter stuff needs to > be involved. Can ->splice_read() and ->splice_write() be given pipe-class iov_iters rather than pipe_inode_info structs? David