xprtrdma: mount reports "Invalid mount option" if memreg mode not supported
authorChuck Lever <chuck.lever@oracle.com>
Wed, 28 May 2014 14:33:00 +0000 (10:33 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 4 Jun 2014 12:56:39 +0000 (08:56 -0400)
If the selected memory registration mode is not supported by the
underlying provider/HCA, the NFS mount command reports that there was
an invalid mount option, and fails. This is misleading.

Reporting a problem allocating memory is a lot closer to the truth.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/xprtrdma/verbs.c

index a3527989f5b3edeb106a4be210c4b40fd8741a38..7c7e9b41f43f6392c59d093c2eb1507a2448ad7c 100644 (file)
@@ -513,7 +513,7 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg)
 #if RPCRDMA_PERSISTENT_REGISTRATION
                        memreg = RPCRDMA_ALLPHYSICAL;
 #else
-                       rc = -EINVAL;
+                       rc = -ENOMEM;
                        goto out2;
 #endif
                }
@@ -554,9 +554,9 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg)
                }
                break;
        default:
-               printk(KERN_ERR "%s: invalid memory registration mode %d\n",
-                               __func__, memreg);
-               rc = -EINVAL;
+               printk(KERN_ERR "RPC: Unsupported memory "
+                               "registration mode: %d\n", memreg);
+               rc = -ENOMEM;
                goto out2;
        }
        dprintk("RPC:       %s: memory registration strategy is %d\n",