NVDIMM Device and Persistent Memory development
 help / color / mirror / Atom feed
From: Shivaprasad G Bhat <sbhat@linux.ibm.com>
To: Tarun Sahu <tsahu@linux.ibm.com>, nvdimm@lists.linux.dev
Cc: dan.j.williams@intel.com, vishal.l.verma@intel.com,
	aneesh.kumar@linux.ibm.com, vaibhav@linux.ibm.com
Subject: Re: [PATCH v3 1/2] ndctl/namespace:Fix multiple issues with write-infoblock
Date: Tue, 24 May 2022 11:39:12 +0530	[thread overview]
Message-ID: <d845a6a5-2924-9e10-ead8-bc05e7965c26@linux.ibm.com> (raw)
In-Reply-To: <20220426172056.122789-2-tsahu@linux.ibm.com>

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

  parent reply	other threads:[~2022-05-24  6:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-26 17:20 [PATCH v3 0/2] ndctl/namespace:Fix and improve write-infoblock Tarun Sahu
2022-04-26 17:20 ` [PATCH v3 1/2] ndctl/namespace:Fix multiple issues with write-infoblock Tarun Sahu
2022-05-24  5:47   ` Shivaprasad G Bhat
2022-05-24  6:09   ` Shivaprasad G Bhat [this message]
2022-04-26 17:20 ` [PATCH v3 2/2] ndctl/namespace:Implement write-infoblock for sector mode namespaces Tarun Sahu
2022-05-13  7:07 ` [PATCH v3 0/2] ndctl/namespace:Fix and improve write-infoblock Tarun Sahu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d845a6a5-2924-9e10-ead8-bc05e7965c26@linux.ibm.com \
    --to=sbhat@linux.ibm.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=dan.j.williams@intel.com \
    --cc=nvdimm@lists.linux.dev \
    --cc=tsahu@linux.ibm.com \
    --cc=vaibhav@linux.ibm.com \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox