linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: trondmy@kernel.org
To: linux-nfs@vger.kernel.org
Subject: [PATCH 14/17] NFS: Simplify cache consistency in nfs_check_inode_attributes()
Date: Mon, 29 Mar 2021 20:18:32 -0400	[thread overview]
Message-ID: <20210330001835.41914-15-trondmy@kernel.org> (raw)
In-Reply-To: <20210330001835.41914-14-trondmy@kernel.org>

From: Trond Myklebust <trond.myklebust@hammerspace.com>

We should not be invalidating the access or acl caches in
nfs_check_inode_attributes(), since the point is we're unsure about
whether the contents of the struct nfs_fattr are fully up to date.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 fs/nfs/inode.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index f60dc562e84b..e1a1322599b8 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1497,8 +1497,7 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat
 	if (!nfs_file_has_buffered_writers(nfsi)) {
 		/* Verify a few of the more important attributes */
 		if ((fattr->valid & NFS_ATTR_FATTR_CHANGE) != 0 && !inode_eq_iversion_raw(inode, fattr->change_attr))
-			invalid |= NFS_INO_INVALID_CHANGE
-				| NFS_INO_REVAL_PAGECACHE;
+			invalid |= NFS_INO_INVALID_CHANGE;
 
 		ts = inode->i_mtime;
 		if ((fattr->valid & NFS_ATTR_FATTR_MTIME) && !timespec64_equal(&ts, &fattr->mtime))
@@ -1512,24 +1511,17 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat
 			cur_size = i_size_read(inode);
 			new_isize = nfs_size_to_loff_t(fattr->size);
 			if (cur_size != new_isize)
-				invalid |= NFS_INO_INVALID_SIZE
-					| NFS_INO_REVAL_PAGECACHE;
+				invalid |= NFS_INO_INVALID_SIZE;
 		}
 	}
 
 	/* Have any file permissions changed? */
 	if ((fattr->valid & NFS_ATTR_FATTR_MODE) && (inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO))
-		invalid |= NFS_INO_INVALID_ACCESS
-			| NFS_INO_INVALID_ACL
-			| NFS_INO_INVALID_OTHER;
+		invalid |= NFS_INO_INVALID_OTHER;
 	if ((fattr->valid & NFS_ATTR_FATTR_OWNER) && !uid_eq(inode->i_uid, fattr->uid))
-		invalid |= NFS_INO_INVALID_ACCESS
-			| NFS_INO_INVALID_ACL
-			| NFS_INO_INVALID_OTHER;
+		invalid |= NFS_INO_INVALID_OTHER;
 	if ((fattr->valid & NFS_ATTR_FATTR_GROUP) && !gid_eq(inode->i_gid, fattr->gid))
-		invalid |= NFS_INO_INVALID_ACCESS
-			| NFS_INO_INVALID_ACL
-			| NFS_INO_INVALID_OTHER;
+		invalid |= NFS_INO_INVALID_OTHER;
 
 	/* Has the link count changed? */
 	if ((fattr->valid & NFS_ATTR_FATTR_NLINK) && inode->i_nlink != fattr->nlink)
-- 
2.30.2


  reply	other threads:[~2021-03-30  0:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30  0:18 [PATCH 00/17] Attribute revalidation updates trondmy
2021-03-30  0:18 ` [PATCH 01/17] NFS: Deal correctly with attribute generation counter overflow trondmy
2021-03-30  0:18   ` [PATCH 02/17] NFS: Fix up inode cache tracing trondmy
2021-03-30  0:18     ` [PATCH 03/17] NFS: Mask out unsupported attributes in nfs_getattr() trondmy
2021-03-30  0:18       ` [PATCH 04/17] NFS: NFS_INO_REVAL_PAGECACHE should mark the change attribute invalid trondmy
2021-03-30  0:18         ` [PATCH 05/17] NFS: Fix up revalidation of space used trondmy
2021-03-30  0:18           ` [PATCH 06/17] NFS: Don't revalidate attributes that are not being asked for trondmy
2021-03-30  0:18             ` [PATCH 07/17] NFS: Fix up statx() results trondmy
2021-03-30  0:18               ` [PATCH 08/17] NFS: Add a cache validity flag argument to nfs_revalidate_inode() trondmy
2021-03-30  0:18                 ` [PATCH 09/17] NFS: Replace use of NFS_INO_REVAL_PAGECACHE when checking cache validity trondmy
2021-03-30  0:18                   ` [PATCH 10/17] NFS: Don't set NFS_INO_REVAL_PAGECACHE in the inode " trondmy
2021-03-30  0:18                     ` [PATCH 11/17] NFS: Separate tracking of file nlinks cache validity from the mode/uid/gid trondmy
2021-03-30  0:18                       ` [PATCH 12/17] NFS: Fix up handling of outstanding layoutcommit in nfs_update_inode() trondmy
2021-03-30  0:18                         ` [PATCH 13/17] NFS: Remove a line of code that has no effect " trondmy
2021-03-30  0:18                           ` trondmy [this message]
2021-03-30  0:18                             ` [PATCH 15/17] NFSv4: Fix value of decode_fsinfo_maxsz trondmy
2021-03-30  0:18                               ` [PATCH 16/17] NFSv4: Add support for the NFSv4.2 "change_attr_type" attribute trondmy
2021-03-30  0:18                                 ` [PATCH 17/17] NFS: Use information about the change attribute to optimise updates trondmy

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=20210330001835.41914-15-trondmy@kernel.org \
    --to=trondmy@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /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).