In ndctl_cmd_ars_in_progress, which expects a successfully completed
ars_status command, we used to invalidate the command by setting its
status to '1', so that the user has to provide a fresh ars_status
command the next time this check is performed.

In hindsight, this is needless and violates the principle of least
surprise. We shouldn't be touching the user's data (command), so remove
this invalidation. If the user uses the same ars_status command again,
we will simply report that ARS is still in progress.

Signed-off-by: Vishal Verma <[email protected]>
---
 ndctl/lib/ars.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/ndctl/lib/ars.c b/ndctl/lib/ars.c
index b199646..48a9819 100644
--- a/ndctl/lib/ars.c
+++ b/ndctl/lib/ars.c
@@ -224,16 +224,7 @@ NDCTL_EXPORT int ndctl_cmd_ars_in_progress(struct 
ndctl_cmd *cmd)
        if (!validate_ars_stat(ctx, cmd))
                return 0;
 
-       if (ndctl_cmd_get_firmware_status(cmd) == 1 << 16) {
-               /*
-                * If in-progress, invalidate the ndctl_cmd, so
-                * that if we're called again without a fresh
-                * ars_status command, we fail.
-                */
-               cmd->status = 1;
-               return 1;
-       }
-       return 0;
+       return (ndctl_cmd_get_firmware_status(cmd) == 1 << 16);
 }
 
 NDCTL_EXPORT unsigned int ndctl_cmd_ars_num_records(struct ndctl_cmd *ars_stat)
-- 
2.17.0

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to