[Libguestfs] [nbdkit PATCH v2 2/6] protocol: Map EROFS to EPERM

Eric Blake eblake at redhat.com
Thu Jan 26 02:42:32 UTC 2017


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 at 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




More information about the Libguestfs mailing list