All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: Scott Mayhew <smayhew@redhat.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: [PATCH 1/3] NFS: Clear NFS_INO_REVAL_PAGECACHE when we update the file size
Date: Fri, 20 Jun 2014 13:41:21 -0400	[thread overview]
Message-ID: <1403286083-14345-2-git-send-email-trond.myklebust@primarydata.com> (raw)
In-Reply-To: <1403286083-14345-1-git-send-email-trond.myklebust@primarydata.com>

In nfs_update_inode(), if the change attribute is seen to change on
the server, then we set NFS_INO_REVAL_PAGECACHE in order to make
sure that we check the file size.
However, if we also update the file size in the same function, we
don't need to check it again. So make sure that we clear the
NFS_INO_REVAL_PAGECACHE that was set earlier.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/nfs/inode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index c496f8a74639..51dda21ebc4e 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1601,6 +1601,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
 			if ((nfsi->npages == 0) || new_isize > cur_isize) {
 				i_size_write(inode, new_isize);
 				invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA;
+				invalid &= ~NFS_INO_REVAL_PAGECACHE;
 			}
 			dprintk("NFS: isize change on server for file %s/%ld "
 					"(%Ld to %Ld)\n",
-- 
1.9.3


  reply	other threads:[~2014-06-20 17:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-13 18:18 [PATCH RFC] nfs: ensure cached data is correct before using delegation Scott Mayhew
2014-06-13 18:18 ` Scott Mayhew
2014-06-13 21:19   ` Trond Myklebust
2014-06-17 21:04     ` Scott Mayhew
2014-06-17 21:37       ` Trond Myklebust
2014-06-20 12:51         ` Scott Mayhew
2014-06-20 17:41           ` [PATCH 0/3] " Trond Myklebust
2014-06-20 17:41             ` Trond Myklebust [this message]
2014-06-20 17:41               ` [PATCH 2/3] NFS: Don't mark the data cache as invalid if it has been flushed Trond Myklebust
2014-06-20 17:41                 ` [PATCH 3/3] nfs: Fix cache_validity check in nfs_write_pageuptodate() Trond Myklebust
2014-06-23 13:55             ` [PATCH 0/3] nfs: ensure cached data is correct before using delegation Scott Mayhew

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=1403286083-14345-2-git-send-email-trond.myklebust@primarydata.com \
    --to=trond.myklebust@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=smayhew@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.