The NBD Protocol requests an EPERM failure on attempts to write to
a read-only export. We were internally using EROFS, but our mapping
was slamming that to EINVAL.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
src/connections.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/connections.c b/src/connections.c
index 1b39547..e15a777 100644
--- a/src/connections.c
+++ b/src/connections.c
@@ -724,6 +724,7 @@ nbd_errno (int error)
switch (error) {
case 0:
return NBD_SUCCESS;
+ case EROFS:
case EPERM:
return NBD_EPERM;
case EIO:
--
2.9.3