The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: paulmck@kernel.org, brauner@kernel.org, jack@suse.cz,
	linux-fsdevel@vger.kernel.org, torvalds@linux-foundation.org,
	edumazet@google.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] fs: elide the smp_rmb fence in fd_install()
Date: Thu, 5 Dec 2024 14:18:50 +0000	[thread overview]
Message-ID: <20241205141850.GS3387508@ZenIV> (raw)
In-Reply-To: <20241205120332.1578562-1-mjguzik@gmail.com>

On Thu, Dec 05, 2024 at 01:03:32PM +0100, Mateusz Guzik wrote:
>  void fd_install(unsigned int fd, struct file *file)
>  {
> -	struct files_struct *files = current->files;
> +	struct files_struct *files;
>  	struct fdtable *fdt;
>  
>  	if (WARN_ON_ONCE(unlikely(file->f_mode & FMODE_BACKING)))
>  		return;
>  
> +	/*
> +	 * Synchronized with expand_fdtable(), see that routine for an
> +	 * explanation.
> +	 */
>  	rcu_read_lock_sched();
> +	files = READ_ONCE(current->files);

What are you trying to do with that READ_ONCE()?  current->files
itself is *not* changed by any of that code; current->files->fdtab is.

  reply	other threads:[~2024-12-05 14:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAGudoHG6zYMfFmhizJDPAw=CF8QY8dzbvg0cSEW4XVcvTYhELw@mail.gmail.com>
2024-12-05 12:03 ` [RFC PATCH] fs: elide the smp_rmb fence in fd_install() Mateusz Guzik
2024-12-05 14:18   ` Al Viro [this message]
2024-12-05 14:43     ` Mateusz Guzik
2024-12-05 18:41       ` Paul E. McKenney
2024-12-05 19:03         ` Mateusz Guzik
2024-12-05 20:01           ` Paul E. McKenney
2024-12-05 20:15             ` Mateusz Guzik
2024-12-05 21:17               ` Paul E. McKenney
2024-12-05 19:26         ` Linus Torvalds
2024-12-05 19:47           ` Mateusz Guzik
2024-12-05 20:11             ` Paul E. McKenney
2024-12-06 12:11               ` Christian Brauner
2024-12-05 20:06           ` Paul E. McKenney
2024-12-05 14:46   ` Jan Kara
2024-12-05 15:01     ` Mateusz Guzik
2024-12-05 15:29       ` Jan Kara
2024-12-05 15:36         ` Mateusz Guzik
2024-12-06 15:32           ` Jan Kara
2024-12-05 14:58   ` Christian Brauner
2024-12-05 15:06     ` Mateusz Guzik

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=20241205141850.GS3387508@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=brauner@kernel.org \
    --cc=edumazet@google.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjguzik@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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