diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-03-06 12:34:50 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-03-07 14:35:37 -0500 |
commit | c37dcd334c0b0a46a90cfa13b9f69e2aaa89bc09 (patch) | |
tree | 0792bbc64fff676c76a696a76a9f703cd9500145 | |
parent | ee1a2c564f67407947e89f1dac75ac0af0ba88c7 (diff) |
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>
-rw-r--r-- | fs/nfs/inode.c | 6 | ||||
-rw-r--r-- | include/linux/nfs_fs.h | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 966a8850aa30..a4c7cf2bff3a 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -299,6 +299,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
299 | else | 299 | else |
300 | inode->i_op = &nfs_mountpoint_inode_operations; | 300 | inode->i_op = &nfs_mountpoint_inode_operations; |
301 | inode->i_fop = NULL; | 301 | inode->i_fop = NULL; |
302 | set_bit(NFS_INO_MOUNTPOINT, &nfsi->flags); | ||
302 | } | 303 | } |
303 | } else if (S_ISLNK(inode->i_mode)) | 304 | } else if (S_ISLNK(inode->i_mode)) |
304 | inode->i_op = &nfs_symlink_inode_operations; | 305 | inode->i_op = &nfs_symlink_inode_operations; |
@@ -1003,8 +1004,9 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1003 | 1004 | ||
1004 | server = NFS_SERVER(inode); | 1005 | server = NFS_SERVER(inode); |
1005 | /* Update the fsid? */ | 1006 | /* Update the fsid? */ |
1006 | if (S_ISDIR(inode->i_mode) | 1007 | if (S_ISDIR(inode->i_mode) && |
1007 | && !nfs_fsid_equal(&server->fsid, &fattr->fsid)) | 1008 | !nfs_fsid_equal(&server->fsid, &fattr->fsid) && |
1009 | !test_bit(NFS_INO_MOUNTPOINT, &nfsi->flags)) | ||
1008 | server->fsid = fattr->fsid; | 1010 | server->fsid = fattr->fsid; |
1009 | 1011 | ||
1010 | /* | 1012 | /* |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index a69ba80f2dfe..f4a0e4c218df 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -195,6 +195,7 @@ struct nfs_inode { | |||
195 | #define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */ | 195 | #define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */ |
196 | #define NFS_INO_STALE (2) /* possible stale inode */ | 196 | #define NFS_INO_STALE (2) /* possible stale inode */ |
197 | #define NFS_INO_ACL_LRU_SET (3) /* Inode is on the LRU list */ | 197 | #define NFS_INO_ACL_LRU_SET (3) /* Inode is on the LRU list */ |
198 | #define NFS_INO_MOUNTPOINT (4) /* inode is remote mountpoint */ | ||
198 | 199 | ||
199 | static inline struct nfs_inode *NFS_I(const struct inode *inode) | 200 | static inline struct nfs_inode *NFS_I(const struct inode *inode) |
200 | { | 201 | { |