linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "J. Bruce Fields" <bfields@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Trond Myklebust <trondmy@hammerspace.com>,
	Anna Schumaker <schumakeranna@gmail.com>,
	Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [PATCH 2/3] nfsd: move change attribute generation to filesystem
Date: Fri, 22 Jan 2021 17:32:48 +0000	[thread overview]
Message-ID: <20210122173248.GB241302@infradead.org> (raw)
In-Reply-To: <20210122144753.GA52753@pick.fieldses.org>

On Fri, Jan 22, 2021 at 09:47:53AM -0500, J. Bruce Fields wrote:
> > > I also have a vague idea that some filesystem-specific improvements
> > > might be possible.  (E.g., if a filesystem had some kind of boot count
> > > in the superblock, maybe that would be a better way to prevent the
> > > change attribute from going backwards on reboot than the thing
> > > generic_fetch_iversion is currently doing with ctime.  But I have no
> > > concrete plan there, maybe I'm dreaming.)
> > 
> > Even without the ctime i_version never goes backward, what is the
> > problem here?
> 
> Suppose a modification bumps the change attribute, a client reads
> the new value of the change attribute before it's committed to disk,
> then the server crashes.  After the server comes back up, the client
> requests the change attribute again and sees an older value.

So all metadata operations kicked off by nfsd are synchronous due
to ->commit_metadata/sync_inode_metadata, so this could only happen
for operations not kicked off by nfsd.  More importanly ctime will
also be lost as i_version and the ctime are commited together.

> 
> That's actually not too bad.  What I'd mainly like to avoid is
> incrementing the change attribute further and risking reuse of an old
> value for a different new state of the file.

Ok but that is an issue if we need to deal with changes that did not
come in through NFSD.

  reply	other threads:[~2021-01-22 17:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19 19:24 [PATCH 0/3] NFS change attribute patches J. Bruce Fields
2021-01-19 19:24 ` [PATCH 1/3] nfs: use change attribute for NFS re-exports J. Bruce Fields
2021-01-19 19:24 ` [PATCH 2/3] nfsd: move change attribute generation to filesystem J. Bruce Fields
2021-01-20  8:46   ` Christoph Hellwig
2021-01-21 20:27     ` J. Bruce Fields
2021-01-22  8:20       ` Christoph Hellwig
2021-01-22 14:47         ` J. Bruce Fields
2021-01-22 17:32           ` Christoph Hellwig [this message]
2021-01-22 18:46             ` J. Bruce Fields
2021-01-29 19:25         ` J. Bruce Fields
2021-01-29 19:26         ` [PATCH 1/2 v2] nfs: use change attribute for NFS re-exports J. Bruce Fields
2021-01-29 19:27           ` [PATCH 2/2 v2] nfsd: skip some unnecessary stats in the v4 case J. Bruce Fields
2021-01-30  6:02             ` Christoph Hellwig
2021-01-29 20:43           ` [PATCH 1/2 v2] nfs: use change attribute for NFS re-exports Chuck Lever
2021-01-30  6:02           ` Christoph Hellwig
2021-01-19 19:24 ` [PATCH 3/3] nfsd: skip some unnecessary stats in the v4 case J. Bruce Fields
2021-01-22 17:34 ` [PATCH 0/3] NFS change attribute patches Christoph Hellwig

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=20210122173248.GB241302@infradead.org \
    --to=hch@infradead.org \
    --cc=bfields@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=schumakeranna@gmail.com \
    --cc=trondmy@hammerspace.com \
    /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;
as well as URLs for NNTP newsgroup(s).