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>
This commit is contained in:
@@ -236,6 +236,7 @@ nfs_get_root(struct super_block *sb, struct nfs_fh *rootfh, struct nfs_fsinfo *f
|
||||
return ERR_PTR(error);
|
||||
}
|
||||
|
||||
server->fsid = fsinfo->fattr->fsid;
|
||||
return nfs_fhget(sb, rootfh, fsinfo->fattr);
|
||||
}
|
||||
|
||||
@@ -1493,6 +1494,7 @@ out:
|
||||
*/
|
||||
static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
|
||||
{
|
||||
struct nfs_server *server;
|
||||
struct nfs_inode *nfsi = NFS_I(inode);
|
||||
loff_t cur_isize, new_isize;
|
||||
unsigned int invalid = 0;
|
||||
@@ -1511,6 +1513,12 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
|
||||
if ((inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT))
|
||||
goto out_changed;
|
||||
|
||||
server = NFS_SERVER(inode);
|
||||
/* Update the fsid if and only if this is the root directory */
|
||||
if (inode == inode->i_sb->s_root->d_inode
|
||||
&& !nfs_fsid_equal(&server->fsid, &fattr->fsid))
|
||||
server->fsid = fattr->fsid;
|
||||
|
||||
/*
|
||||
* Update the read time so we don't revalidate too often.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user