diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-09 09:34:19 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-09 09:34:19 -0400 |
commit | 8b4bdcf8995dd92b23d2ec22b32aee8fbbb50e1c (patch) | |
tree | 8ebe9ec2ed5cb58592097123cf6b34af997316c7 /fs/nfs/inode.c | |
parent | 8b512d9a88875affe584bb3d2a7a235f84343b9e (diff) |
NFS: Store the file system "fsid" value in the NFS super block.
This should enable us to detect if we are crossing a mountpoint in the
case where the server is exporting "nohide" mounts.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index fda2b4966179..1a809f6f8989 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -236,6 +236,7 @@ nfs_get_root(struct super_block *sb, struct nfs_fh *rootfh, struct nfs_fsinfo *f | |||
236 | return ERR_PTR(error); | 236 | return ERR_PTR(error); |
237 | } | 237 | } |
238 | 238 | ||
239 | server->fsid = fsinfo->fattr->fsid; | ||
239 | return nfs_fhget(sb, rootfh, fsinfo->fattr); | 240 | return nfs_fhget(sb, rootfh, fsinfo->fattr); |
240 | } | 241 | } |
241 | 242 | ||
@@ -1493,6 +1494,7 @@ out: | |||
1493 | */ | 1494 | */ |
1494 | static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | 1495 | static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) |
1495 | { | 1496 | { |
1497 | struct nfs_server *server; | ||
1496 | struct nfs_inode *nfsi = NFS_I(inode); | 1498 | struct nfs_inode *nfsi = NFS_I(inode); |
1497 | loff_t cur_isize, new_isize; | 1499 | loff_t cur_isize, new_isize; |
1498 | unsigned int invalid = 0; | 1500 | unsigned int invalid = 0; |
@@ -1511,6 +1513,12 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1511 | if ((inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) | 1513 | if ((inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) |
1512 | goto out_changed; | 1514 | goto out_changed; |
1513 | 1515 | ||
1516 | server = NFS_SERVER(inode); | ||
1517 | /* Update the fsid if and only if this is the root directory */ | ||
1518 | if (inode == inode->i_sb->s_root->d_inode | ||
1519 | && !nfs_fsid_equal(&server->fsid, &fattr->fsid)) | ||
1520 | server->fsid = fattr->fsid; | ||
1521 | |||
1514 | /* | 1522 | /* |
1515 | * Update the read time so we don't revalidate too often. | 1523 | * Update the read time so we don't revalidate too often. |
1516 | */ | 1524 | */ |