All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Max Kellermann <max.kellermann@ionos.com>
Cc: dhowells@redhat.com, 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 11:17:29 +0200	[thread overview]
Message-ID: <20230921-nahen-ausklammern-aa91c8f49a1c@brauner> (raw)
In-Reply-To: <CAKPOu+9RC6XCKh0a0HNEFmjPCn8n=BvGwRHk13hJKWD2N_+OcQ@mail.gmail.com>

On Thu, Sep 21, 2023 at 10:05:24AM +0200, Max Kellermann wrote:
> On Thu, Sep 21, 2023 at 9:28 AM Max Kellermann <max.kellermann@ionos.com> wrote:
> > 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?
> 
> Meanwhile I have figured that the spinlock in pipe_write() is
> obsolete. It was added by David as preparation for the notification
> feature, but the notification was finally merged, it had the EXDEV,
> and I believe it was not initially planned to implement it that way?

It was supposed to get write support most likely but never got it.
Good catch.

> So I believe the spinlock is really not necessary (anymore) and I have

For pipe_write() it isn't we still need it for pipe_read().

  reply	other threads:[~2023-09-21 19:01 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
2023-09-21  8:05     ` Max Kellermann
2023-09-21  9:17       ` Christian Brauner [this message]
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=20230921-nahen-ausklammern-aa91c8f49a1c@brauner \
    --to=brauner@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=max.kellermann@ionos.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.