Skip to content

Commit 3b47fd5

Browse files
committed
Merge tag 'nfs-for-5.3-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client bugfix from Trond Myklebust: "Regression fix inode fileid checks in attribute revalidation code" * tag 'nfs-for-5.3-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: NFS: Fix inode fileid checks in attribute revalidation code
2 parents 089cf7f + eb3d8f4 commit 3b47fd5

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

fs/nfs/inode.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,11 +1403,12 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat
14031403
if (NFS_PROTO(inode)->have_delegation(inode, FMODE_READ))
14041404
return 0;
14051405

1406-
/* No fileid? Just exit */
1407-
if (!(fattr->valid & NFS_ATTR_FATTR_FILEID))
1408-
return 0;
1406+
if (!(fattr->valid & NFS_ATTR_FATTR_FILEID)) {
1407+
/* Only a mounted-on-fileid? Just exit */
1408+
if (fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID)
1409+
return 0;
14091410
/* Has the inode gone and changed behind our back? */
1410-
if (nfsi->fileid != fattr->fileid) {
1411+
} else if (nfsi->fileid != fattr->fileid) {
14111412
/* Is this perhaps the mounted-on fileid? */
14121413
if ((fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID) &&
14131414
nfsi->fileid == fattr->mounted_on_fileid)
@@ -1807,11 +1808,12 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
18071808
nfs_display_fhandle_hash(NFS_FH(inode)),
18081809
atomic_read(&inode->i_count), fattr->valid);
18091810

1810-
/* No fileid? Just exit */
1811-
if (!(fattr->valid & NFS_ATTR_FATTR_FILEID))
1812-
return 0;
1811+
if (!(fattr->valid & NFS_ATTR_FATTR_FILEID)) {
1812+
/* Only a mounted-on-fileid? Just exit */
1813+
if (fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID)
1814+
return 0;
18131815
/* Has the inode gone and changed behind our back? */
1814-
if (nfsi->fileid != fattr->fileid) {
1816+
} else if (nfsi->fileid != fattr->fileid) {
18151817
/* Is this perhaps the mounted-on fileid? */
18161818
if ((fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID) &&
18171819
nfsi->fileid == fattr->mounted_on_fileid)

0 commit comments

Comments
 (0)