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

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