nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-nvdimm@lists.01.org
Subject: [ndctl PATCH v3 8/8] ndctl/namespace: Report ENOSPC when regions are full
Date: Fri, 02 Aug 2019 16:55:08 -0700	[thread overview]
Message-ID: <156479010859.707590.12017196692329765020.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <156479006271.707590.298793474092813749.stgit@dwillia2-desk3.amr.corp.intel.com>

The create-namespace error message:

    failed to create namespace: Resource temporarily unavailable

...is misleading because the lack of capacity is permanent until the
user frees up space.

Trap EAGAIN and translate to ENOSPC in case the region capacity search
fails:

    failed to create namespace: No space left on device

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 ndctl/namespace.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ndctl/namespace.c b/ndctl/namespace.c
index 5c457224cb13..89113f760bbf 100644
--- a/ndctl/namespace.c
+++ b/ndctl/namespace.c
@@ -1415,6 +1415,15 @@ static int do_xaction_namespace(const char *namespace,
 		}
 	}
 
+	if (action == ACTION_CREATE && rc == -EAGAIN) {
+		/*
+		 * Namespace creation searched through all candidate
+		 * regions and all of them said "nope, I don't have
+		 * enough capacity", so report -ENOSPC
+		 */
+		rc = -ENOSPC;
+	}
+
 	return rc;
 }
 

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

      parent reply	other threads:[~2019-08-03  0:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-02 23:54 [ndctl PATCH v3 0/8] Improvements for namespace creation/interrogation Dan Williams
2019-08-02 23:54 ` [ndctl PATCH v3 1/8] ndctl/build: Suppress -Waddress-of-packed-member Dan Williams
2019-08-05 16:54   ` Jeff Moyer
2019-08-05 17:34     ` Dan Williams
2019-08-05 17:45       ` Jeff Moyer
2019-08-05 19:50       ` Dan Williams
2019-08-02 23:54 ` [ndctl PATCH v3 2/8] ndctl/dimm: Support small label reads/writes Dan Williams
2019-08-02 23:54 ` [ndctl PATCH v3 3/8] ndctl/dimm: Minimize data-transfer for init-labels Dan Williams
2019-08-02 23:54 ` [ndctl PATCH v3 4/8] ndctl/dimm: Add offset and size options to {read, write, zero}-labels Dan Williams
2019-08-02 23:54 ` [ndctl PATCH v3 5/8] ndctl/dimm: Limit read-labels with --index option Dan Williams
2019-08-02 23:54 ` [ndctl PATCH v3 6/8] ndctl/namespace: Minimize label data transfer for autolabel Dan Williams
2019-08-02 23:55 ` [ndctl PATCH v3 7/8] ndctl/namespace: Continue region search on 'missing seed' event Dan Williams
2019-08-02 23:55 ` Dan Williams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=156479010859.707590.12017196692329765020.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).