+ nfs-fix-nfsv4-callback-regression.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     NFS: Fix NFSv4 callback regression

has been added to the -mm tree.  Its filename is

     nfs-fix-nfsv4-callback-regression.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: NFS: Fix NFSv4 callback regression
From: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>

The change in semantics for nfs_find_client() introduced by David breaks the
NFSv4 callback channel.

Also, replace another completely broken BUG_ON() in nfs_find_client().  In
initialised clients, clp->cl_cons_state == 0, and callers of that function
should in any case never want to see clients that are uninitialised.

Signed-off-by: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/nfs/client.c |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff -puN fs/nfs/client.c~nfs-fix-nfsv4-callback-regression fs/nfs/client.c
--- a/fs/nfs/client.c~nfs-fix-nfsv4-callback-regression
+++ a/fs/nfs/client.c
@@ -232,11 +232,15 @@ void nfs_put_client(struct nfs_client *c
  * Find a client by address
  * - caller must hold nfs_client_lock
  */
-static struct nfs_client *__nfs_find_client(const struct sockaddr_in *addr, int nfsversion)
+static struct nfs_client *__nfs_find_client(const struct sockaddr_in *addr, int nfsversion, int match_port)
 {
 	struct nfs_client *clp;
 
 	list_for_each_entry(clp, &nfs_client_list, cl_share_link) {
+		/* Don't match clients that failed to initialise properly */
+		if (clp->cl_cons_state < 0)
+			continue;
+
 		/* Different NFS versions cannot share the same nfs_client */
 		if (clp->cl_nfsversion != nfsversion)
 			continue;
@@ -245,7 +249,7 @@ static struct nfs_client *__nfs_find_cli
 			   sizeof(clp->cl_addr.sin_addr)) != 0)
 			continue;
 
-		if (clp->cl_addr.sin_port == addr->sin_port)
+		if (!match_port || clp->cl_addr.sin_port == addr->sin_port)
 			goto found;
 	}
 
@@ -265,11 +269,12 @@ struct nfs_client *nfs_find_client(const
 	struct nfs_client *clp;
 
 	spin_lock(&nfs_client_lock);
-	clp = __nfs_find_client(addr, nfsversion);
+	clp = __nfs_find_client(addr, nfsversion, 0);
 	spin_unlock(&nfs_client_lock);
-
-	BUG_ON(clp && clp->cl_cons_state == 0);
-
+	if (clp != NULL && clp->cl_cons_state != NFS_CS_READY) {
+		nfs_put_client(clp);
+		clp = NULL;
+	}
 	return clp;
 }
 
@@ -292,7 +297,7 @@ static struct nfs_client *nfs_get_client
 	do {
 		spin_lock(&nfs_client_lock);
 
-		clp = __nfs_find_client(addr, nfsversion);
+		clp = __nfs_find_client(addr, nfsversion, 1);
 		if (clp)
 			goto found_client;
 		if (new)
_

Patches currently in -mm which might be from Trond.Myklebust@xxxxxxxxxx are

nfsv4-fix-thinko-in-fs-nfs-superc.patch
nfs-fix-oops-in-nfs_cancel_commit_list.patch
nfs-fix-error-handling-in-nfs_direct_write_result.patch
nfs4-initialize-cl_ipaddr.patch
nfs-fix-nfsv4-callback-regression.patch
nfs-deal-with-failure-of-invalidate_inode_pages2.patch
nfs-fix-minor-bug-in-new-nfs-symlink-code.patch
nfs-__nfs_revalidate_inode-can-use-inode-before.patch
nfs-remove-unused-check-in-nfs4_open_revalidate.patch
sunrpc-fix-race-in-in-kernel-rpc-portmapper-client.patch
sunrpc-fix-a-typo.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux