linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Jan Stancek <jstancek@redhat.com>
Cc: dhowells@redhat.com, kuba@kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	brauner@kernel.org, viro@zeniv.linux.org.uk
Subject: Re: [PATCH] splice, net: Fix splice_to_socket() for O_NONBLOCK socket
Date: Mon, 24 Jul 2023 11:12:12 +0100	[thread overview]
Message-ID: <64434.1690193532@warthog.procyon.org.uk> (raw)
In-Reply-To: <7854000d2ce5ac32b75782a7c4574f25a11b573d.1689757133.git.jstancek@redhat.com>

Jan Stancek <jstancek@redhat.com> wrote:

> LTP sendfile07 [1], which expects sendfile() to return EAGAIN when
> transferring data from regular file to a "full" O_NONBLOCK socket,
> started failing after commit 2dc334f1a63a ("splice, net: Use
> sendmsg(MSG_SPLICE_PAGES) rather than ->sendpage()").
> sendfile() no longer immediately returns, but now blocks.
> 
> Removed sock_sendpage() handled this case by setting a MSG_DONTWAIT
> flag, fix new splice_to_socket() to do the same for O_NONBLOCK sockets.

Does this actually work correctly in all circumstances?

The problem might come if you have a splice from a non-rewindable source
through a temporary pipe (eg. sendfile() using splice_direct_to_actor()).

David


  reply	other threads:[~2023-07-24 10:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19  9:07 [PATCH] splice, net: Fix splice_to_socket() for O_NONBLOCK socket Jan Stancek
2023-07-24 10:12 ` David Howells [this message]
2023-07-24 14:51   ` Jan Stancek
2023-07-24 15:44   ` David Howells
2023-07-24 17:09     ` Jakub Kicinski
2023-07-24 17:37       ` Jan Stancek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64434.1690193532@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=brauner@kernel.org \
    --cc=jstancek@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).