One more comment..

On 4/26/22 22:50, Tarun Sahu wrote:
Write-infoblock command has the below issues,
1 - Oerwriting the existing alignment value with the default value when
       not passed as parameter.
2 - Changing the mode of the namespace to fsdax when -m not specified
3 - Incorrectly updating the uuid and parent_uuid if corresponding

<snip>
---
  ndctl/namespace.c | 253 +++++++++++++++++++++++++++++++---------------
  1 file changed, 170 insertions(+), 83 deletions(-)
<snip>

diff --git a/ndctl/namespace.c b/ndctl/namespace.c
index 257b58c..cca9a51 100644
--- a/ndctl/namespace.c
+++ b/ndctl/namespace.c

<snip>

@@ -2121,11 +2197,17 @@ static int do_xaction_namespace(const char *namespace,
                }
if (param.infile || !namespace) {
-                       rc = file_read_infoblock(param.infile, NULL, &ri_ctx);
-                       if (ri_ctx.jblocks)
-                               util_display_json_array(ri_ctx.f_out, 
ri_ctx.jblocks, 0);
-                       if (rc >= 0)
-                               (*processed)++;
+                       struct ns_info ns_info;

Move this to the beginning of the block.

+
+                       rc = ns_info_init(&ns_info);
+                       if (!rc) {
+                               rc = file_read_infoblock(param.infile, NULL, 
&ri_ctx, &ns_info);
+                               if (ri_ctx.jblocks)
+                                       util_display_json_array(ri_ctx.f_out, 
ri_ctx.jblocks, 0);
+                               if (rc >= 0)
+                                       (*processed)++;
+                       }
+                       ns_info_destroy(&ns_info);
                        return rc;
                }
        }

Thanks,
Shivaprasad

Reply via email to