]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: added error MNT_ERR_NAMESPACE
authorVaclav Dolezal <vdolezal@redhat.com>
Tue, 13 Mar 2018 13:45:43 +0000 (14:45 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 11 Jun 2018 13:51:17 +0000 (15:51 +0200)
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
libmount/src/context_mount.c
libmount/src/context_umount.c
libmount/src/libmount.h.in

index 6207bd8148f1311337f3ff659d03f55f346d52bb..9245d73dd7fed93ac07fba4d44283c518f8f2494 100644 (file)
@@ -1452,6 +1452,10 @@ int mnt_context_get_mount_excode(
                        if (buf)
                                snprintf(buf, bufsz, _("locking failed"));
                        return MNT_EX_FILEIO;
+               case -MNT_ERR_NAMESPACE:
+                       if (buf)
+                               snprintf(buf, bufsz, _("failed to switch namespace"));
+                       return MNT_EX_SYSERR;
                default:
                        return mnt_context_get_generic_excode(rc, buf, bufsz, _("mount failed: %m"));
                }
@@ -1465,6 +1469,10 @@ int mnt_context_get_mount_excode(
                        if (buf)
                                snprintf(buf, bufsz, _("filesystem was mounted, but failed to update userspace mount table"));
                        return MNT_EX_FILEIO;
+               } else if (rc == -MNT_ERR_NAMESPACE) {
+                       if (buf)
+                               snprintf(buf, bufsz, _("filesystem was mounted, but failed to switch namespace back"));
+                       return MNT_EX_SYSERR;
 
                } else if (rc < 0)
                        return mnt_context_get_generic_excode(rc, buf, bufsz,
index 81a650352c27608eef04d24e4b845e867427b763..3e320bec941ee0b0fa9668f89700a9a46d934a8e 100644 (file)
@@ -1076,6 +1076,10 @@ int mnt_context_get_umount_excode(
                        if (buf)
                                snprintf(buf, bufsz, _("locking failed"));
                        return MNT_EX_FILEIO;
+               } else if (rc == -MNT_ERR_NAMESPACE) {
+                       if (buf)
+                               snprintf(buf, bufsz, _("failed to switch namespace"));
+                       return MNT_EX_SYSERR;
                }
                return mnt_context_get_generic_excode(rc, buf, bufsz,
                                        _("umount failed: %m"));
@@ -1089,6 +1093,10 @@ int mnt_context_get_umount_excode(
                        if (buf)
                                snprintf(buf, bufsz, _("filesystem was unmounted, but failed to update userspace mount table"));
                        return MNT_EX_FILEIO;
+               } else if (rc == -MNT_ERR_NAMESPACE) {
+                       if (buf)
+                               snprintf(buf, bufsz, _("filesystem was unmounted, but failed to switch namespace back"));
+                       return MNT_EX_SYSERR;
 
                } else if (rc < 0)
                        return mnt_context_get_generic_excode(rc, buf, bufsz,
index 885729dfb4f4b83eed6b9e5d59ce41aac2a3ada4..3a9440371cfa1ad9237c10abb802956237f5f53d 100644 (file)
@@ -205,6 +205,12 @@ enum {
  * failed to lock mtab/utab or so.
  */
 #define MNT_ERR_LOCK         5008
+/**
+ * MNT_ERR_NAMESPACE:
+ *
+ * failed to switch namespace
+ */
+#define MNT_ERR_NAMESPACE    5009
 
 
 /*