All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <linux@treblig.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Mateusz Guzik <mjguzik@gmail.com>,
	"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,
	Linus Torvalds <torvalds@linux-foundation.org>
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 22:10:31 +0000	[thread overview]
Message-ID: <Z0OkVxY3CW9fV8tp@gallifrey> (raw)
In-Reply-To: <20241124215014.GA3387508@ZenIV>

* Al Viro (viro@zeniv.linux.org.uk) wrote:
> [Linus Cc'd]
> On Sun, Nov 24, 2024 at 06:56:57PM +0100, Mateusz Guzik wrote:
> 
> > However, since both sec and nsec are updated separately and there is no
> > synchro, reading *both* can still result in values from 2 different
> > updates which is a bug not addressed by any of the above. To my
> > underestanding of the vfs folk take on it this is considered tolerable.
> 
> Well...   You have a timestamp changing.  A reader might get the value
> before change, the value after change *or* one of those with nanoseconds
> from another.  It's really hard to see the scenario where that would
> be a problem - theoretically something might get confused seeing something
> like
> 	Jan 14 1995 12:34:49.214 ->
> 	Jan 14 1995 12:34:49.137 ->
> 	Nov 23 2024 14:09:17.137
> but... what would that something be?

make?
i.e. if the change was from:
 a) mmm dd yyyy hh::MM::00:950 ->
 b) mmm dd yyyy hh::MM::01:950 ->
 c) mmm dd yyyy hh::MM::01:200 ->
   
If you read (b) then you'd think that the file was 750ms newer
than it really was; which is a long time these days.

Dave

> We could add a seqcount, but stat(2) and friends already cost more than
> they should, IMO...
> 
> Linus, do you see any good reasons to bother with that kind of stuff?
> It's not the first time such metadata update vs. read atomicity comes
> up, maybe we ought to settle that for good and document the decision
> and reasons for it.
> 
> This time it's about timestamp (seconds vs. nanoseconds), but there'd
> been mode vs. uid vs. gid mentioned in earlier threads.
> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

  parent reply	other threads:[~2024-11-24 22:10 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
2024-11-25 12:20                     ` Christian Brauner
2024-11-24 22:10                   ` Dr. David Alan Gilbert [this message]
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=Z0OkVxY3CW9fV8tp@gallifrey \
    --to=linux@treblig.org \
    --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=viro@zeniv.linux.org.uk \
    --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 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.