From patchwork Fri Aug 2 23:55:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 11074259 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B8F041399 for ; Sat, 3 Aug 2019 00:09:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A97C8288E6 for ; Sat, 3 Aug 2019 00:09:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E09C288EC; Sat, 3 Aug 2019 00:09:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5626F288E6 for ; Sat, 3 Aug 2019 00:09:28 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B03DF21314738; Fri, 2 Aug 2019 17:11:58 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=dan.j.williams@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6980221311C11 for ; Fri, 2 Aug 2019 17:11:57 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2019 17:09:26 -0700 X-IronPort-AV: E=Sophos;i="5.64,340,1559545200"; d="scan'208";a="191953258" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2019 17:09:26 -0700 Subject: [ndctl PATCH v3 8/8] ndctl/namespace: Report ENOSPC when regions are full From: Dan Williams To: linux-nvdimm@lists.01.org Date: Fri, 02 Aug 2019 16:55:08 -0700 Message-ID: <156479010859.707590.12017196692329765020.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <156479006271.707590.298793474092813749.stgit@dwillia2-desk3.amr.corp.intel.com> References: <156479006271.707590.298793474092813749.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-2-gc94f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; }