Skip to content

Commit cdd9ade

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: mount reports "Invalid mount option" if memreg mode not supported
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>
1 parent f10eafd commit cdd9ade

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/sunrpc/xprtrdma/verbs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg)
513513
#if RPCRDMA_PERSISTENT_REGISTRATION
514514
memreg = RPCRDMA_ALLPHYSICAL;
515515
#else
516-
rc = -EINVAL;
516+
rc = -ENOMEM;
517517
goto out2;
518518
#endif
519519
}
@@ -554,9 +554,9 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg)
554554
}
555555
break;
556556
default:
557-
printk(KERN_ERR "%s: invalid memory registration mode %d\n",
558-
__func__, memreg);
559-
rc = -EINVAL;
557+
printk(KERN_ERR "RPC: Unsupported memory "
558+
"registration mode: %d\n", memreg);
559+
rc = -ENOMEM;
560560
goto out2;
561561
}
562562
dprintk("RPC: %s: memory registration strategy is %d\n",

0 commit comments

Comments
 (0)