public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Hao-ran Zheng <zhenghaoran@buaa.edu.cn>,
	brauner@kernel.org, jack@suse.cz, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, baijiaju1990@gmail.com,
	21371365@buaa.edu.cn
Subject: Re: [RFC] metadata updates vs. fetches (was Re: [PATCH v4] fs: Fix data race in inode_set_ctime_to_ts)
Date: Sun, 24 Nov 2024 23:38:28 +0000	[thread overview]
Message-ID: <20241124233828.GC3387508@ZenIV> (raw)
In-Reply-To: <CAGudoHEqDaY3=KuV9CuPja8UgVBhiZVZ7ej5r1yoSxRZaMnknA@mail.gmail.com>

On Mon, Nov 25, 2024 at 12:05:29AM +0100, Mateusz Guzik wrote:
> On Sun, Nov 24, 2024 at 11:10 PM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> > So I mention the "rename and extend i_size_seqcount" as a solution
> > that I suspect might be acceptable if somebody has the motivation and
> > energy, but honestly I also think "nobody can be bothered" is
> > acceptable in practice.
> >
> 
> So happens recently the metadata ordeal also came up around getattr
> where a submitter wanted to lock the inode around it.

The posting Linus had been replying to:
https://lore.kernel.org/all/20241124215014.GA3387508@ZenIV/

> Until the day comes when someone has way too much time on their hands
> and patches it up (even that may encounter resistance though), I do
> think it would make sense to nicely write it down somewhere so for
> easy reference -- maybe as a comment above getattr and note around
> other places like the timespec helpers to read that.

See above.

For those who'd missed the getattr thread - the approach proposed and
NAKed there was to take ->i_rwsem (shared) in stat(2).  A non-starter
for obvious reasons, IMO.  Seqcount avoids those, but it would need to
be a pair of primitives used around the stores, with i_size_write()
*not* usable inside such scope.  Potential problems would be the
amount of time spent inside those scopes and amount of spinning it
would cause on the stat(2) side + the inode bloat.

All of that is modulo usefulness of such atomicity - nothing mentioned
so far seems to be a good reason to bother with all of that in the
first place...

  parent reply	other threads:[~2024-11-24 23:38 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20  2:43 [PATCH] fs: Fix data race in inode_set_ctime_to_ts Hao-ran Zheng
2024-11-21 11:35 ` Jan Kara
2024-11-22  3:51   ` [PATCH v2] " Hao-ran Zheng
2024-11-22 11:13     ` Christian Brauner
2024-11-22 11:22     ` Jan Kara
2024-11-22 11:48       ` 郑浩然
2024-11-22 13:06       ` [PATCH v3] " Hao-ran Zheng
2024-11-23 14:01         ` Jeff Layton
2024-11-24  8:46           ` 郑浩然
2024-11-24  9:42           ` [PATCH v4] " Hao-ran Zheng
2024-11-24 17:44             ` Darrick J. Wong
2024-11-24 17:56               ` Mateusz Guzik
2024-11-24 18:34                 ` Darrick J. Wong
2024-11-24 21:50                 ` [RFC] metadata updates vs. fetches (was Re: [PATCH v4] fs: Fix data race in inode_set_ctime_to_ts) Al Viro
2024-11-24 22:10                   ` Linus Torvalds
2024-11-24 22:24                     ` Al Viro
2024-11-24 22:34                       ` Matthew Wilcox
2024-11-24 22:43                         ` Linus Torvalds
2024-11-24 23:53                           ` Matthew Wilcox
2024-11-25  0:53                             ` Linus Torvalds
2024-11-25  1:02                               ` Linus Torvalds
2024-11-25  1:15                               ` Matthew Wilcox
2024-11-25  1:26                                 ` Linus Torvalds
2024-11-24 22:40                       ` Linus Torvalds
2024-11-24 23:05                     ` Mateusz Guzik
2024-11-24 23:19                       ` Mateusz Guzik
2024-11-24 23:41                         ` Al Viro
2024-11-24 23:38                       ` Al Viro [this message]
2024-11-25 12:20                     ` Christian Brauner
2024-11-24 22:10                   ` Dr. David Alan Gilbert
2024-11-24 22:19                     ` Matthew Wilcox
  -- strict thread matches above, loose matches on Subject: below --
2024-11-26  6:44 郑浩然

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=20241124233828.GC3387508@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=21371365@buaa.edu.cn \
    --cc=baijiaju1990@gmail.com \
    --cc=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjguzik@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=zhenghaoran@buaa.edu.cn \
    /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