Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'io_uring-5.7-2020-05-15' of git://git.kernel.dk/linux-block

Pull io_uring fixes from Jens Axboe:
"Two small fixes that should go into this release:

- Check and handle zero length splice (Pavel)

- Fix a regression in this merge window for fixed files used with
polled block IO"

* tag 'io_uring-5.7-2020-05-15' of git://git.kernel.dk/linux-block:
io_uring: polled fixed file must go through free iteration
io_uring: fix zero len do_splice()

+8 -9
+8 -9
fs/io_uring.c
··· 1394 1394 for (i = 0; i < rb->to_free; i++) { 1395 1395 struct io_kiocb *req = rb->reqs[i]; 1396 1396 1397 - if (req->flags & REQ_F_FIXED_FILE) { 1398 - req->file = NULL; 1399 - percpu_ref_put(req->fixed_file_refs); 1400 - } 1401 1397 if (req->flags & REQ_F_INFLIGHT) 1402 1398 inflight++; 1403 1399 __io_req_aux_free(req); ··· 1666 1670 if ((req->flags & REQ_F_LINK_HEAD) || io_is_fallback_req(req)) 1667 1671 return false; 1668 1672 1669 - if (!(req->flags & REQ_F_FIXED_FILE) || req->io) 1673 + if (req->file || req->io) 1670 1674 rb->need_iter++; 1671 1675 1672 1676 rb->reqs[rb->to_free++] = req; ··· 2763 2767 struct file *out = sp->file_out; 2764 2768 unsigned int flags = sp->flags & ~SPLICE_F_FD_IN_FIXED; 2765 2769 loff_t *poff_in, *poff_out; 2766 - long ret; 2770 + long ret = 0; 2767 2771 2768 2772 if (force_nonblock) 2769 2773 return -EAGAIN; 2770 2774 2771 2775 poff_in = (sp->off_in == -1) ? NULL : &sp->off_in; 2772 2776 poff_out = (sp->off_out == -1) ? NULL : &sp->off_out; 2773 - ret = do_splice(in, poff_in, out, poff_out, sp->len, flags); 2774 - if (force_nonblock && ret == -EAGAIN) 2775 - return -EAGAIN; 2777 + 2778 + if (sp->len) { 2779 + ret = do_splice(in, poff_in, out, poff_out, sp->len, flags); 2780 + if (force_nonblock && ret == -EAGAIN) 2781 + return -EAGAIN; 2782 + } 2776 2783 2777 2784 io_put_file(req, in, (sp->flags & SPLICE_F_FD_IN_FIXED)); 2778 2785 req->flags &= ~REQ_F_NEED_CLEANUP;