linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Max Kellermann <max.kellermann@ionos.com>
To: Christian Brauner <brauner@kernel.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: When to lock pipe->rd_wait.lock?
Date: Thu, 21 Sep 2023 09:28:13 +0200	[thread overview]
Message-ID: <CAKPOu+_Ebj6-YXPd4HWqG7TokZDvw26uM4xuJGL7k0gg+tHeyw@mail.gmail.com> (raw)
In-Reply-To: <20230920-macht-rupfen-96240ce98330@brauner>

On Wed, Sep 20, 2023 at 3:30 PM Christian Brauner <brauner@kernel.org> wrote:
> Afaict, the mutex is sufficient protection unless you're using
> watchqueues which use post_one_notification() that cannot acquire the
> pipe mutex. Since splice operations aren't supported on such kernel
> notification pipes - see get_pipe_info() - it should be unproblematic.

I had another look at this, and something's fishy with the code or
with your explanation (or I still don't get it). If there is a
watch_queue, pipe_write() fails early with EXDEV - writing to such a
pipe is simply forbidden, the code is not reachable in the presence of
a watch_queue, therefore locking just because there might be a
wait_queue does not appear to make sense?

  parent reply	other threads:[~2023-09-21 18:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 12:34 When to lock pipe->rd_wait.lock? Max Kellermann
2023-09-20 13:30 ` Christian Brauner
2023-09-20 15:21   ` Max Kellermann
2023-09-20 15:50     ` Christian Brauner
2023-09-20 16:14       ` Max Kellermann
2023-09-21  7:28   ` Max Kellermann [this message]
2023-09-21  8:05     ` Max Kellermann
2023-09-21  9:17       ` Christian Brauner
2023-09-21  9:38         ` Max Kellermann

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=CAKPOu+_Ebj6-YXPd4HWqG7TokZDvw26uM4xuJGL7k0gg+tHeyw@mail.gmail.com \
    --to=max.kellermann@ionos.com \
    --cc=brauner@kernel.org \
    --cc=linux-fsdevel@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).