From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "Williams, Dan J" <dan.j.williams@intel.com>
Cc: "linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>
Subject: Re: [PATCH] daxctl: Fix memblock enumeration off-by-one
Date: Fri, 3 Feb 2023 23:07:54 +0000 [thread overview]
Message-ID: <a892091d7275984f9878b288a01079f52d5934f7.camel@intel.com> (raw)
In-Reply-To: <167537140762.3268840.2926966718345830138.stgit@dwillia2-xfh.jf.intel.com>
On Thu, 2023-02-02 at 12:56 -0800, Dan Williams wrote:
> A memblock is an inclusive memory range. Bound the search by the last
> address in the memory block.
>
> Found by wondering why an offline 32-block (at 128MB == 4GB) range was
> reported as 33 blocks with one online.
>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
> daxctl/lib/libdaxctl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Good find! Applied, thanks.
>
> diff --git a/daxctl/lib/libdaxctl.c b/daxctl/lib/libdaxctl.c
> index 5703992f5b88..d990479d8585 100644
> --- a/daxctl/lib/libdaxctl.c
> +++ b/daxctl/lib/libdaxctl.c
> @@ -1477,7 +1477,7 @@ static int memblock_in_dev(struct daxctl_memory *mem, const char *memblock)
> err(ctx, "%s: Unable to determine resource\n", devname);
> return -EACCES;
> }
> - dev_end = dev_start + daxctl_dev_get_size(dev);
> + dev_end = dev_start + daxctl_dev_get_size(dev) - 1;
>
> memblock_size = daxctl_memory_get_block_size(mem);
> if (!memblock_size) {
>
prev parent reply other threads:[~2023-02-03 23:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-02 20:56 [PATCH] daxctl: Fix memblock enumeration off-by-one Dan Williams
2023-02-03 0:03 ` Eliot Moss
2023-02-03 0:11 ` Dan Williams
2023-02-03 0:59 ` Eliot Moss
2023-02-03 23:07 ` Verma, Vishal L [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=a892091d7275984f9878b288a01079f52d5934f7.camel@intel.com \
--to=vishal.l.verma@intel.com \
--cc=dan.j.williams@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
/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