{13/17} - nfs-fix-nfs-reval-fsid - series for stable kernel #2
mainline: a0356862bcbeb20acf64bc1a82d28a4c5bb957a7
Signature · 2 lines
Thanks, Oliver
Patch-mainline: 2.6.24
References: 271803
GIT: a0356862bcbeb20acf64bc1a82d28a4c5bb957a7 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <[email protected]>
Date: Tue, 5 Jun 2007 13:26:15 -0400
Subject: [PATCH] NFS: Fix nfs_reval_fsid()
We don't need to revalidate the fsid on the root directory. It suffices to revalidate it on the current directory.
--- fs/nfs/dir.c | 9 ++++----- fs/nfs/inode.c | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-)
fs/nfs/dir.c +4 -5
@@ -897,14 +897,13 @@ int nfs_is_exclusive_create(struct inode *dir, struct nameidata *nd)return (nd->intent.open.flags &O_EXCL ) !=0 ; } -static inline int nfs_reval_fsid (struct vfsmount *mnt,struct inode *dir, -struct nfs_fh *fh,struct nfs_fattr *fattr) +static inline int nfs_reval_fsid (struct inode *dir,const struct nfs_fattr *fattr) {struct nfs_server *server =NFS_SERVER (dir);if (!nfs_fsid_equal (&server->fsid, &fattr->fsid)) -/* Revalidate fsid on root dir */ -return __nfs_revalidate_inode (server, mnt->mnt_root->d_inode); +/* Revalidate fsid using the parent directory */ +return __nfs_revalidate_inode (server, dir);return 0 ; }
@@ -946,7 +945,7 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru res =ERR_PTR (error); goto out_unlock; } - error =nfs_reval_fsid (nd->mnt, dir, &fhandle, &fattr); + error =nfs_reval_fsid (dir, &fattr);if (error <0 ) { res =ERR_PTR (error); goto out_unlock;
fs/nfs/inode.c +2 -2
@@ -961,8 +961,8 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) 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 +/* Update the fsid? */ +if (S_ISDIR (inode->i_mode) && !nfs_fsid_equal (&server->fsid, &fattr->fsid)) server->fsid = fattr->fsid;
Signature · 1 line
1.5.3.6
Oliver Pinter
Acked-by NeilBrownPatch-mainline: 2.6.24
References: 271803
GIT: a0356862bcbeb20acf64bc1a82d28a4c5bb957a7 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <[email protected]>
Date: Tue, 5 Jun 2007 13:26:15 -0400
Subject: [PATCH] NFS: Fix nfs_reval_fsid()
We don't need to revalidate the fsid on the root directory. It suffices to revalidate it on the current directory.
--- fs/nfs/dir.c | 9 ++++----- fs/nfs/inode.c | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-)
fs/nfs/dir.c +0 -0
@@ -897,14 +897,13 @@ int nfs_is_exclusive_create(struct inode *dir,
struct nameidata *nd)
return (nd->intent.open.flags & O_EXCL) != 0;
}
-static inline int nfs_reval_fsid(struct vfsmount *mnt, struct inode *dir,
- struct nfs_fh *fh, struct nfs_fattr *fattr)
+static inline int nfs_reval_fsid(struct inode *dir, const struct nfs_fattr *fattr)
{
struct nfs_server *server = NFS_SERVER(dir);
if (!nfs_fsid_equal(&server->fsid, &fattr->fsid))
- /* Revalidate fsid on root dir */
- return __nfs_revalidate_inode(server, mnt->mnt_root->d_inode);
+ /* Revalidate fsid using the parent directory */
+ return __nfs_revalidate_inode(server, dir);
return 0;
}
@@ -946,7 +945,7 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
res = ERR_PTR(error);
goto out_unlock;
}
- error = nfs_reval_fsid(nd->mnt, dir, &fhandle, &fattr);
+ error = nfs_reval_fsid(dir, &fattr);
if (error < 0) {
res = ERR_PTR(error);
goto out_unlock;
fs/nfs/inode.c +0 -0
@@ -961,8 +961,8 @@ static int nfs_update_inode(struct inode *inode,
struct nfs_fattr *fattr)
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
+ /* Update the fsid? */
+ if (S_ISDIR(inode->i_mode)
&& !nfs_fsid_equal(&server->fsid, &fattr->fsid))
server->fsid = fattr->fsid;
Signature · 1 line
1.5.3.6
Quoted 7 lines · Oliver Pinter (Pintér Olivér)
mainline:
a0356862bcbeb20acf64bc1a82d28a4c5bb957a7--
Thanks,
Oliver
Signature · 2 lines
Thanks, Oliver