NFS: Fix the fsid revalidation in nfs_update_inode()

When we detect that we've crossed a mountpoint on the remote server, we
must take care not to use that inode to revalidate the fsid on our
current superblock. To do so, we label the inode as a remote mountpoint,
and check for that in nfs_update_inode().

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

+5 -2
+4 -2
fs/nfs/inode.c
··· 299 else 300 inode->i_op = &nfs_mountpoint_inode_operations; 301 inode->i_fop = NULL; 302 } 303 } else if (S_ISLNK(inode->i_mode)) 304 inode->i_op = &nfs_symlink_inode_operations; ··· 1004 1005 server = NFS_SERVER(inode); 1006 /* Update the fsid? */ 1007 - if (S_ISDIR(inode->i_mode) 1008 - && !nfs_fsid_equal(&server->fsid, &fattr->fsid)) 1009 server->fsid = fattr->fsid; 1010 1011 /*
··· 299 else 300 inode->i_op = &nfs_mountpoint_inode_operations; 301 inode->i_fop = NULL; 302 + set_bit(NFS_INO_MOUNTPOINT, &nfsi->flags); 303 } 304 } else if (S_ISLNK(inode->i_mode)) 305 inode->i_op = &nfs_symlink_inode_operations; ··· 1003 1004 server = NFS_SERVER(inode); 1005 /* Update the fsid? */ 1006 + if (S_ISDIR(inode->i_mode) && 1007 + !nfs_fsid_equal(&server->fsid, &fattr->fsid) && 1008 + !test_bit(NFS_INO_MOUNTPOINT, &nfsi->flags)) 1009 server->fsid = fattr->fsid; 1010 1011 /*
+1
include/linux/nfs_fs.h
··· 195 #define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */ 196 #define NFS_INO_STALE (2) /* possible stale inode */ 197 #define NFS_INO_ACL_LRU_SET (3) /* Inode is on the LRU list */ 198 199 static inline struct nfs_inode *NFS_I(const struct inode *inode) 200 {
··· 195 #define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */ 196 #define NFS_INO_STALE (2) /* possible stale inode */ 197 #define NFS_INO_ACL_LRU_SET (3) /* Inode is on the LRU list */ 198 + #define NFS_INO_MOUNTPOINT (4) /* inode is remote mountpoint */ 199 200 static inline struct nfs_inode *NFS_I(const struct inode *inode) 201 {