From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Quentin Barnes <qbarnes+nfs@yahoo-inc.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: nfs_file_flush() question
Date: Tue, 19 Aug 2008 17:30:52 -0700 [thread overview]
Message-ID: <1219192252.7150.30.camel@localhost> (raw)
In-Reply-To: <20080819201731.GA25036@yahoo-inc.com>
On Tue, 2008-08-19 at 15:17 -0500, Quentin Barnes wrote:
> > If I don't know the correct mtime attribute of the file when I close it,
>
> If I follow the code, you do know the mtime when closing the
> file. With V3, from the WRITE and COMMIT, you're given weak cache
> consistency data containing the the updated mtimes, correct?
No. Please note the difference between a call to nfs_update_inode(), and
a call to nfs_refresh_inode(). The latter tries to be more careful about
updating the inode attributes if there is a chance that we may have
raced with another RPC call to the same inode, and hence that the
attributes returned may be stale.
> But making the change to nfs_revalidate_inode() by itself only
> helps in the case where the file was open O_RDWR and no write(2)
> was done. The code still needed to be updated to use the WCC data
> at the right time. In the older kernels when nfs_wb_all() ended up
> calling nfs_update_inode() which was clearing the cache when it saw
> the mtime change from the WRITE. I tracked down why. Newer kernels
> (2.6.24 and later) had nfs_post_op_update_inode_force_wcc() call
> added to nfs3_write_done() which updated the inode with the WCC data
> from the WRITE so the later call to nfs_update_inode() didn't see
> an unexpected mtime change flagging the attribute and data cache as
> invalid.
See above.
Cheers
Trond
next prev parent reply other threads:[~2008-08-20 0:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-17 0:23 nfs_file_flush() question Quentin Barnes
2008-08-17 17:04 ` Trond Myklebust
2008-08-18 16:04 ` Chuck Lever
2008-08-18 16:53 ` Trond Myklebust
2008-08-19 20:17 ` Quentin Barnes
2008-08-20 0:30 ` Trond Myklebust [this message]
2008-08-20 3:38 ` Quentin Barnes
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=1219192252.7150.30.camel@localhost \
--to=trond.myklebust@fys.uio.no \
--cc=linux-nfs@vger.kernel.org \
--cc=qbarnes+nfs@yahoo-inc.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