Blame SOURCES/0025-ndctl-scrub-Stop-translating-return-values.patch

e0018b
From c52109355b715bbe21e284090435bee7563863cc Mon Sep 17 00:00:00 2001
e0018b
From: Dan Williams <dan.j.williams@intel.com>
e0018b
Date: Wed, 26 May 2021 16:33:04 -0700
e0018b
Subject: [PATCH 025/217] ndctl/scrub: Stop translating return values
e0018b
e0018b
In preparation for triggering a poll loop within ndctl_bus_start_scrub(),
e0018b
stop translating return values into -EOPNOTSUPP.
e0018b
e0018b
Link: https://lore.kernel.org/r/162207198482.3715490.5994844104395495686.stgit@dwillia2-desk3.amr.corp.intel.com
e0018b
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
e0018b
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
e0018b
---
e0018b
 ndctl/lib/libndctl.c | 8 +-------
e0018b
 1 file changed, 1 insertion(+), 7 deletions(-)
e0018b
e0018b
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
e0018b
index aa36a3c..e5641fe 100644
e0018b
--- a/ndctl/lib/libndctl.c
e0018b
+++ b/ndctl/lib/libndctl.c
e0018b
@@ -1354,14 +1354,8 @@ static int __ndctl_bus_get_scrub_state(struct ndctl_bus *bus,
e0018b
 NDCTL_EXPORT int ndctl_bus_start_scrub(struct ndctl_bus *bus)
e0018b
 {
e0018b
 	struct ndctl_ctx *ctx = ndctl_bus_get_ctx(bus);
e0018b
-	int rc;
e0018b
 
e0018b
-	rc = sysfs_write_attr(ctx, bus->scrub_path, "1\n");
e0018b
-	if (rc == -EBUSY)
e0018b
-		return rc;
e0018b
-	else if (rc < 0)
e0018b
-		return -EOPNOTSUPP;
e0018b
-	return 0;
e0018b
+	return sysfs_write_attr(ctx, bus->scrub_path, "1\n");
e0018b
 }
e0018b
 
e0018b
 NDCTL_EXPORT int ndctl_bus_get_scrub_state(struct ndctl_bus *bus)
e0018b
-- 
e0018b
2.27.0
e0018b