nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] libnvdimm, pmem: Fix memcpy_mcsafe() return code handling in nsio_rw_bytes()
@ 2018-06-18 17:52 Dan Williams
  2018-06-18 19:12 ` Vishal Verma
  2018-06-18 22:05 ` Jeff Moyer
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Williams @ 2018-06-18 17:52 UTC (permalink / raw)
  To: linux-nvdimm; +Cc: linux-kernel

Commit 60622d68227d "x86/asm/memcpy_mcsafe: Return bytes remaining"
converted callers of memcpy_mcsafe() to expect a positive 'bytes
remaining' value rather than a negative error code. The nsio_rw_bytes()
conversion failed to return success. The failure is benign in that
nsio_rw_bytes() will end up writing back what it just read.

Fixes: 60622d68227d ("x86/asm/memcpy_mcsafe: Return bytes remaining")
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/nvdimm/claim.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
index 2e96b34bc936..fb667bf469c7 100644
--- a/drivers/nvdimm/claim.c
+++ b/drivers/nvdimm/claim.c
@@ -278,6 +278,7 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
 			return -EIO;
 		if (memcpy_mcsafe(buf, nsio->addr + offset, size) != 0)
 			return -EIO;
+		return 0;
 	}
 
 	if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) {

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] libnvdimm, pmem: Fix memcpy_mcsafe() return code handling in nsio_rw_bytes()
  2018-06-18 17:52 [PATCH] libnvdimm, pmem: Fix memcpy_mcsafe() return code handling in nsio_rw_bytes() Dan Williams
@ 2018-06-18 19:12 ` Vishal Verma
  2018-06-18 22:05 ` Jeff Moyer
  1 sibling, 0 replies; 3+ messages in thread
From: Vishal Verma @ 2018-06-18 19:12 UTC (permalink / raw)
  To: Dan Williams; +Cc: linux-kernel, linux-nvdimm

On 06/18, Dan Williams wrote:
> Commit 60622d68227d "x86/asm/memcpy_mcsafe: Return bytes remaining"
> converted callers of memcpy_mcsafe() to expect a positive 'bytes
> remaining' value rather than a negative error code. The nsio_rw_bytes()
> conversion failed to return success. The failure is benign in that
> nsio_rw_bytes() will end up writing back what it just read.
> 
> Fixes: 60622d68227d ("x86/asm/memcpy_mcsafe: Return bytes remaining")
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Vishal Verma <vishal.l.verma@intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  drivers/nvdimm/claim.c |    1 +
>  1 file changed, 1 insertion(+)

Ah good catch. Looks good to me.
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>

> 
> diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
> index 2e96b34bc936..fb667bf469c7 100644
> --- a/drivers/nvdimm/claim.c
> +++ b/drivers/nvdimm/claim.c
> @@ -278,6 +278,7 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
>  			return -EIO;
>  		if (memcpy_mcsafe(buf, nsio->addr + offset, size) != 0)
>  			return -EIO;
> +		return 0;
>  	}
>  
>  	if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) {
> 
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libnvdimm, pmem: Fix memcpy_mcsafe() return code handling in nsio_rw_bytes()
  2018-06-18 17:52 [PATCH] libnvdimm, pmem: Fix memcpy_mcsafe() return code handling in nsio_rw_bytes() Dan Williams
  2018-06-18 19:12 ` Vishal Verma
@ 2018-06-18 22:05 ` Jeff Moyer
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Moyer @ 2018-06-18 22:05 UTC (permalink / raw)
  To: Dan Williams; +Cc: linux-kernel, linux-nvdimm

Dan Williams <dan.j.williams@intel.com> writes:

> Commit 60622d68227d "x86/asm/memcpy_mcsafe: Return bytes remaining"
> converted callers of memcpy_mcsafe() to expect a positive 'bytes
> remaining' value rather than a negative error code. The nsio_rw_bytes()
> conversion failed to return success. The failure is benign in that
> nsio_rw_bytes() will end up writing back what it just read.
>
> Fixes: 60622d68227d ("x86/asm/memcpy_mcsafe: Return bytes remaining")
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Vishal Verma <vishal.l.verma@intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  drivers/nvdimm/claim.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
> index 2e96b34bc936..fb667bf469c7 100644
> --- a/drivers/nvdimm/claim.c
> +++ b/drivers/nvdimm/claim.c
> @@ -278,6 +278,7 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
>  			return -EIO;
>  		if (memcpy_mcsafe(buf, nsio->addr + offset, size) != 0)
>  			return -EIO;
> +		return 0;
>  	}
>  
>  	if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) {

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-18 22:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18 17:52 [PATCH] libnvdimm, pmem: Fix memcpy_mcsafe() return code handling in nsio_rw_bytes() Dan Williams
2018-06-18 19:12 ` Vishal Verma
2018-06-18 22:05 ` Jeff Moyer

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 NNTP newsgroup(s).