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