lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241002091405.7b2s4qvoaqrn3l4f@quack3>
Date: Wed, 2 Oct 2024 11:14:05 +0200
From: Jan Kara <jack@...e.cz>
To: Jeff Layton <jlayton@...nel.org>
Cc: Jan Kara <jack@...e.cz>, John Stultz <jstultz@...gle.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Stephen Boyd <sboyd@...nel.org>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Christian Brauner <brauner@...nel.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
	Jonathan Corbet <corbet@....net>,
	Randy Dunlap <rdunlap@...radead.org>,
	Chandan Babu R <chandan.babu@...cle.com>,
	"Darrick J. Wong" <djwong@...nel.org>,
	Theodore Ts'o <tytso@....edu>,
	Andreas Dilger <adilger.kernel@...ger.ca>, Chris Mason <clm@...com>,
	Josef Bacik <josef@...icpanda.com>, David Sterba <dsterba@...e.com>,
	Hugh Dickins <hughd@...gle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Chuck Lever <chuck.lever@...cle.com>,
	Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	linux-trace-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
	linux-xfs@...r.kernel.org, linux-ext4@...r.kernel.org,
	linux-btrfs@...r.kernel.org, linux-nfs@...r.kernel.org,
	linux-mm@...ck.org
Subject: Re: [PATCH v8 02/12] fs: add infrastructure for multigrain timestamps

On Tue 01-10-24 09:34:18, Jeff Layton wrote:
> On Tue, 2024-10-01 at 15:20 +0200, Jan Kara wrote:
> > > diff --git a/fs/stat.c b/fs/stat.c
> > > index 41e598376d7e..381926fb405f 100644
> > > --- a/fs/stat.c
> > > +++ b/fs/stat.c
> > > @@ -26,6 +26,35 @@
> > >  #include "internal.h"
> > >  #include "mount.h"
> > >  
> > > +/**
> > > + * fill_mg_cmtime - Fill in the mtime and ctime and flag ctime as QUERIED
> > > + * @stat: where to store the resulting values
> > > + * @request_mask: STATX_* values requested
> > > + * @inode: inode from which to grab the c/mtime
> > > + *
> > > + * Given @inode, grab the ctime and mtime out if it and store the result
> > 						 ^^ of
> > 
> > > + * in @stat. When fetching the value, flag it as QUERIED (if not already)
> > > + * so the next write will record a distinct timestamp.
> > > + */
> > > +void fill_mg_cmtime(struct kstat *stat, u32 request_mask, struct inode *inode)
> > > +{
> > 
> > Given how things worked out in the end, it seems this function doesn't need
> > to handle mtime at all and we can move mtime handling back to shared generic
> > code?
> > 
> 
> I don't think we can. The mtime is effectively derived from the ctime.
> 
> If I query only the mtime, I think it's reasonable to expect that it
> will change if there is another write, even if I don't query the ctime.
> We won't get that unless we can also set the flag in the ctime when
> only the mtime is requested.

Aha, right. I already forgot about this :). Can you please add to the
comment the above explanation so that we remember next time somebody wants
to "clean this up" like me ;)? Thanks!

Also feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ