Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
ndctl.31882
ndctl-namespace-skip-zero-namespaces-when-proce...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ndctl-namespace-skip-zero-namespaces-when-processing.patch of Package ndctl.31882
From 9bd2994f91bb77604521cbe09a76a51d092c2cfd Mon Sep 17 00:00:00 2001 From: Michal Suchanek <msuchanek@suse.de> Date: Wed, 6 Jan 2021 14:17:40 +0100 Subject: [PATCH] ndctl/namespace: Skip seed namespaces when processing all namespaces. Upstream: v72 Git-commit: 9bd2994f91bb77604521cbe09a76a51d092c2cfd The seed namespaces are exposed by the kernel but most operations are not valid on seed namespaces. When processing all namespaces the user gets confusing errors from ndctl trying to process seed namespaces. The kernel does not provide any way to tell that a namspace is seed namespace but skipping namespaces with zero size and UUID is a good heuristic. The user can still specify the namespace by name directly in case processing it is desirable. Link: https://patchwork.kernel.org/patch/11473645/ Link: https://lore.kernel.org/r/e55ae2c17b8b9c3288491efe6214338118e8c5ae.1609938610.git.msuchanek@suse.de Fixes: #41 Tested-by: Harish Sriram <harish@linux.ibm.com> Reviewed-by: Santosh S <santosh@fossix.org> Signed-off-by: Michal Suchanek <msuchanek@suse.de> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> --- ndctl/namespace.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ndctl/namespace.c b/ndctl/namespace.c index 1e8a2cd..5e65ed5 100644 --- a/ndctl/namespace.c +++ b/ndctl/namespace.c @@ -2210,9 +2210,19 @@ static int do_xaction_namespace(const char *namespace, ndctl_namespace_foreach_safe(region, ndns, _n) { ndns_name = ndctl_namespace_get_devname(ndns); - if (strcmp(namespace, "all") != 0 - && strcmp(namespace, ndns_name) != 0) - continue; + if (strcmp(namespace, "all") == 0) { + static const uuid_t zero_uuid; + uuid_t uuid; + + ndctl_namespace_get_uuid(ndns, uuid); + if (!ndctl_namespace_get_size(ndns) && + !memcmp(uuid, zero_uuid, sizeof(uuid_t))) + continue; + } else { + if (strcmp(namespace, ndns_name) != 0) + continue; + } + switch (action) { case ACTION_DISABLE: rc = ndctl_namespace_disable_safe(ndns); -- 2.35.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor