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: <96dd05ee4ec91ea4ee25e1af395975d37893fcfc.camel@kernel.org>
Date: Fri, 09 Aug 2024 11:05:54 -0400
From: Jeff Layton <jlayton@...nel.org>
To: Christian Brauner <brauner@...nel.org>
Cc: Alexander Viro <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.cz>, 
 Mateusz Guzik <mjguzik@...il.com>, linux-fsdevel@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs: don't overwrite the nsec field if I_CTIME_QUERIED
 is already set

On Fri, 2024-08-09 at 16:55 +0200, Christian Brauner wrote:
> On Fri, Aug 09, 2024 at 09:39:43AM GMT, Jeff Layton wrote:
> > When fetching the ctime's nsec value for a stat-like operation, do
> > a
> > simple fetch first and avoid the atomic_fetch_or if the flag is
> > already
> > set.
> > 
> > Suggested-by: Mateusz Guzik <mjguzik@...il.com>
> > Signed-off-by: Jeff Layton <jlayton@...nel.org>
> > ---
> > I'm running tests on this now, but I don't expect any problems.
> > 
> > This is based on top of Christian's vfs.mgtime branch. It may be
> > best to
> > squash this into 6feb43ecdd8e ("fs: add infrastructure for
> > multigrain
> > timestamps").
> 
> Squashed it. Can you double-check that things look correct?

One minor issue in fill_mg_cmtime:

-------------8<-----------------
        if (!(stat->ctime.tv_nsec & I_CTIME_QUERIED))
                stat->ctime.tv_nsec = ((u32)atomic_fetch_or(I_CTIME_QUERIED, pcn));
        trace_fill_mg_cmtime(inode, &stat->ctime, &stat->mtime);
        stat->ctime.tv_nsec &= ~I_CTIME_QUERIED;
}
-------------8<-----------------

I'd swap the last two lines of the function. We print the ctime in the
tracepoint as a timestamp, so if the QUERIED bit is present it's going
to look funny. We _know_ that it's flagged after this function, so
leaving it set is not terribly helpful.

-- 
Jeff Layton <jlayton@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ