|
|
26ccd9 |
From 80e0d88c3098bd419e26146a8cb3b693fdd06417 Mon Sep 17 00:00:00 2001
|
|
|
26ccd9 |
From: Santosh Sivaraj <santosh@fossix.org>
|
|
|
26ccd9 |
Date: Wed, 6 Jan 2021 14:17:42 +0100
|
|
|
26ccd9 |
Subject: [PATCH 030/217] namespace-action: Drop zero namespace checks.
|
|
|
0670da |
|
|
|
26ccd9 |
With seed namespaces catched early on these checks for sizes in enable
|
|
|
26ccd9 |
and destroy namespace code path are not needed.
|
|
|
0670da |
|
|
|
26ccd9 |
Reverts commit b9cb03f6d5a8 ("ndctl/namespace: Fix enable-namespace
|
|
|
26ccd9 |
error for seed namespaces")
|
|
|
0670da |
|
|
|
26ccd9 |
Reverts commit e01045e58ad5 ("ndctl/namespace: Fix destroy-namespace
|
|
|
26ccd9 |
accounting relative to seed devices")
|
|
|
26ccd9 |
|
|
|
26ccd9 |
Link: https://patchwork.kernel.org/patch/11739975/
|
|
|
26ccd9 |
Link: https://lore.kernel.org/r/eb4bc7885708fa13e3d37286bc4a4219b1e4e5b6.1609938610.git.msuchanek@suse.de
|
|
|
26ccd9 |
Fixes: b9cb03f6d5a8 ("ndctl/namespace: Fix enable-namespace error for seed namespaces")
|
|
|
26ccd9 |
Fixes: e01045e58ad5 ("ndctl/namespace: Fix destroy-namespace accounting relative to seed devices")
|
|
|
26ccd9 |
Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
|
|
|
26ccd9 |
[rebased on top of the previous patches]
|
|
|
26ccd9 |
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
|
|
|
26ccd9 |
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
|
|
|
26ccd9 |
---
|
|
|
26ccd9 |
ndctl/lib/libndctl.c | 5 -----
|
|
|
26ccd9 |
ndctl/namespace.c | 10 ----------
|
|
|
26ccd9 |
2 files changed, 15 deletions(-)
|
|
|
0670da |
|
|
|
0670da |
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
|
|
|
0670da |
index 536e142..87f60b9 100644
|
|
|
0670da |
--- a/ndctl/lib/libndctl.c
|
|
|
0670da |
+++ b/ndctl/lib/libndctl.c
|
|
|
0670da |
@@ -4531,16 +4531,11 @@ NDCTL_EXPORT int ndctl_namespace_enable(struct ndctl_namespace *ndns)
|
|
|
0670da |
const char *devname = ndctl_namespace_get_devname(ndns);
|
|
|
0670da |
struct ndctl_ctx *ctx = ndctl_namespace_get_ctx(ndns);
|
|
|
0670da |
struct ndctl_region *region = ndns->region;
|
|
|
0670da |
- unsigned long long size = ndctl_namespace_get_size(ndns);
|
|
|
0670da |
int rc;
|
|
|
0670da |
|
|
|
0670da |
if (ndctl_namespace_is_enabled(ndns))
|
|
|
0670da |
return 0;
|
|
|
0670da |
|
|
|
0670da |
- /* Don't try to enable idle namespace (no capacity allocated) */
|
|
|
0670da |
- if (size == 0)
|
|
|
0670da |
- return -ENXIO;
|
|
|
0670da |
-
|
|
|
0670da |
rc = ndctl_bind(ctx, ndns->module, devname);
|
|
|
0670da |
|
|
|
0670da |
/*
|
|
|
0670da |
diff --git a/ndctl/namespace.c b/ndctl/namespace.c
|
|
|
0670da |
index cd822b3..c67c086 100644
|
|
|
0670da |
--- a/ndctl/namespace.c
|
|
|
0670da |
+++ b/ndctl/namespace.c
|
|
|
0670da |
@@ -1164,15 +1164,12 @@ static int namespace_destroy(struct ndctl_region *region,
|
|
|
0670da |
struct ndctl_namespace *ndns)
|
|
|
0670da |
{
|
|
|
0670da |
const char *devname = ndctl_namespace_get_devname(ndns);
|
|
|
0670da |
- unsigned long long size;
|
|
|
0670da |
int rc;
|
|
|
0670da |
|
|
|
0670da |
rc = namespace_prep_reconfig(region, ndns);
|
|
|
0670da |
if (rc < 0)
|
|
|
0670da |
return rc;
|
|
|
0670da |
|
|
|
0670da |
- size = ndctl_namespace_get_size(ndns);
|
|
|
0670da |
-
|
|
|
0670da |
/* Labeled namespace, destroy label / allocation */
|
|
|
0670da |
if (rc == 2) {
|
|
|
0670da |
rc = ndctl_namespace_delete(ndns);
|
|
|
0670da |
@@ -1180,13 +1177,6 @@ static int namespace_destroy(struct ndctl_region *region,
|
|
|
0670da |
debug("%s: failed to reclaim\n", devname);
|
|
|
0670da |
}
|
|
|
0670da |
|
|
|
0670da |
- /*
|
|
|
0670da |
- * Don't report a destroyed namespace when no capacity was
|
|
|
0670da |
- * allocated.
|
|
|
0670da |
- */
|
|
|
0670da |
- if (size == 0 && rc == 0)
|
|
|
0670da |
- rc = 1;
|
|
|
0670da |
-
|
|
|
0670da |
return rc;
|
|
|
0670da |
}
|
|
|
0670da |
|
|
|
26ccd9 |
--
|
|
|
26ccd9 |
2.27.0
|
|
|
26ccd9 |
|