From: Jeff Layton <jlayton@kernel.org>
To: Christian Brauner <brauner@kernel.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
Mateusz Guzik <mjguzik@gmail.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: don't overwrite the nsec field if I_CTIME_QUERIED is already set
Date: Fri, 09 Aug 2024 11:05:54 -0400 [thread overview]
Message-ID: <96dd05ee4ec91ea4ee25e1af395975d37893fcfc.camel@kernel.org> (raw)
In-Reply-To: <20240809-ausrollen-halsschlagader-02e0126179bc@brauner>
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@gmail.com>
> > Signed-off-by: Jeff Layton <jlayton@kernel.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@kernel.org>
next prev parent reply other threads:[~2024-08-09 15:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 13:39 [PATCH] fs: don't overwrite the nsec field if I_CTIME_QUERIED is already set Jeff Layton
2024-08-09 14:55 ` Christian Brauner
2024-08-09 15:05 ` Jeff Layton [this message]
2024-08-09 15:17 ` Christian Brauner
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=96dd05ee4ec91ea4ee25e1af395975d37893fcfc.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjguzik@gmail.com \
--cc=viro@zeniv.linux.org.uk \
/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