NVDIMM Device and Persistent Memory development
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Xiao Yang <yangx.jy@fujitsu.com>, <nvdimm@lists.linux.dev>
Cc: <linux-cxl@vger.kernel.org>
Subject: Re: [PATCH] libdaxctl: Add accurate check for daxctl_memory_op(MEM_GET_ZONE)
Date: Fri, 13 Oct 2023 15:27:08 -0700	[thread overview]
Message-ID: <dcf0a90e-5b13-48e4-af89-e6a08e9139e7@intel.com> (raw)
In-Reply-To: <20231009103521.1463-1-yangx.jy@fujitsu.com>



On 10/9/23 03:35, Xiao Yang wrote:
> The return number of daxctl_memory_op(MEM_GET_ZONE) indicates
> how many memory blocks have the same memory zone. So It's wrong
> to compare mem->zone and zone only when zero is returned.
> 
> Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>

You are correct. Thanks.

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  daxctl/lib/libdaxctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/daxctl/lib/libdaxctl.c b/daxctl/lib/libdaxctl.c
> index b27a8af..4f9aba0 100644
> --- a/daxctl/lib/libdaxctl.c
> +++ b/daxctl/lib/libdaxctl.c
> @@ -1616,7 +1616,7 @@ static int daxctl_memory_online_with_zone(struct daxctl_memory *mem,
>  	 */
>  	mem->zone = 0;
>  	rc = daxctl_memory_op(mem, MEM_GET_ZONE);
> -	if (rc)
> +	if (rc < 0)
>  		return rc;
>  	if (mem->zone != zone) {
>  		err(ctx,

      reply	other threads:[~2023-10-13 22:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-09 10:35 [PATCH] libdaxctl: Add accurate check for daxctl_memory_op(MEM_GET_ZONE) Xiao Yang
2023-10-13 22:27 ` Dave Jiang [this message]

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=dcf0a90e-5b13-48e4-af89-e6a08e9139e7@intel.com \
    --to=dave.jiang@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=yangx.jy@fujitsu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).