LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [2.6.22.y] {13/17} - nfs-fix-nfs-reval-fsid - series for stable kernel #2
@ 2008-02-02  1:34 Oliver Pinter (Pintér Olivér)
  2008-02-06 23:04 ` Oliver Pinter
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Pinter (Pintér Olivér) @ 2008-02-02  1:34 UTC (permalink / raw)
  To: Linux Kernel, stable, stable-commits
  Cc: chrisw, Greg KH, Willy Tarreau, Adrian Bunk, Trond Myklebust, NeilBrown

[-- Attachment #1: Type: text/plain, Size: 72 bytes --]

mainline: a0356862bcbeb20acf64bc1a82d28a4c5bb957a7


-- 
Thanks,
Oliver

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nfs-fix-nfs-reval-fsid --]
[-- Type: text/x-diff; name=nfs-fix-nfs-reval-fsid, Size: 2197 bytes --]

Patch-mainline: 2.6.24
References: 271803
GIT: a0356862bcbeb20acf64bc1a82d28a4c5bb957a7 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <Trond.Myklebust@netapp.com>
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.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: NeilBrown <neilb@suse.de>

---
 fs/nfs/dir.c   |    9 ++++-----
 fs/nfs/inode.c |    4 ++--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 4948ec1..c02a796 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -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;
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 23ecf03..7bcb3df 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -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;
 
-- 
1.5.3.6


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [2.6.22.y] {13/17} - nfs-fix-nfs-reval-fsid - series for stable kernel #2
  2008-02-02  1:34 [2.6.22.y] {13/17} - nfs-fix-nfs-reval-fsid - series for stable kernel #2 Oliver Pinter (Pintér Olivér)
@ 2008-02-06 23:04 ` Oliver Pinter
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Pinter @ 2008-02-06 23:04 UTC (permalink / raw)
  To: Linux Kernel, stable, stable-commits

Patch-mainline: 2.6.24
References: 271803
GIT: a0356862bcbeb20acf64bc1a82d28a4c5bb957a7 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <Trond.Myklebust@netapp.com>
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.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: NeilBrown <neilb@suse.de>

---
 fs/nfs/dir.c   |    9 ++++-----
 fs/nfs/inode.c |    4 ++--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 4948ec1..c02a796 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -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;
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 23ecf03..7bcb3df 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -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;

-- 
1.5.3.6



On 2/2/08, Oliver Pinter (Pintér Olivér) <oliver.pntr@gmail.com> wrote:
> mainline: a0356862bcbeb20acf64bc1a82d28a4c5bb957a7
>
>
> --
> Thanks,
> Oliver
>


-- 
Thanks,
Oliver

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-06 23:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-02  1:34 [2.6.22.y] {13/17} - nfs-fix-nfs-reval-fsid - series for stable kernel #2 Oliver Pinter (Pintér Olivér)
2008-02-06 23:04 ` Oliver Pinter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).