All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-cli : fix offset advance in nvme-ioctl.c: nvme_get_properties()
@ 2018-06-24  7:37 Eyal BenDavid
  2018-06-27 17:34 ` Fwd: " Eyal BenDavid
  0 siblings, 1 reply; 5+ messages in thread
From: Eyal BenDavid @ 2018-06-24  7:37 UTC (permalink / raw)


In the case of 64 bit property, the offset loop variable is advanced
correctly only on error. When the call to nvme_property is successful
(and thus err == 0) the offset variable is advanced by 4 bytes only.

Here is a small patch that fixes the offset:

diff --git i/nvme-ioctl.c w/nvme-ioctl.c
index 63ff8fb..d52dd0a 100644
--- i/nvme-ioctl.c
+++ w/nvme-ioctl.c
@@ -572,8 +572,10 @@ int nvme_get_properties(int fd, void **pbar)
                        continue;
                }
                ret = 0;
-               if (is64bit)
+             if (is64bit) {
                        *(uint64_t *)(*pbar + off) = le64_to_cpu(value64);
+                       off += 4;
+               }

                else
                        *(uint32_t *)(*pbar + off) = le32_to_cpu(value64);
        }

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

* Fwd: [PATCH] nvme-cli : fix offset advance in nvme-ioctl.c: nvme_get_properties()
  2018-06-24  7:37 [PATCH] nvme-cli : fix offset advance in nvme-ioctl.c: nvme_get_properties() Eyal BenDavid
@ 2018-06-27 17:34 ` Eyal BenDavid
  2018-06-27 17:42   ` Keith Busch
  0 siblings, 1 reply; 5+ messages in thread
From: Eyal BenDavid @ 2018-06-27 17:34 UTC (permalink / raw)


In case it was missed.
Thanks


---------- Forwarded message ---------
From: Eyal BenDavid <bdeyal@gmail.com>
Date: Sun, Jun 24, 2018 at 10:37 AM
Subject: [PATCH] nvme-cli : fix offset advance in nvme-ioctl.c:
nvme_get_properties()
To: linux-nvme <linux-nvme at lists.infradead.org>


In the case of 64 bit property, the offset loop variable is advanced
correctly only on error. When the call to nvme_property is successful
(and thus err == 0) the offset variable is advanced by 4 bytes only.

Here is a small patch that fixes the offset:

diff --git i/nvme-ioctl.c w/nvme-ioctl.c
index 63ff8fb..d52dd0a 100644
--- i/nvme-ioctl.c
+++ w/nvme-ioctl.c
@@ -572,8 +572,10 @@ int nvme_get_properties(int fd, void **pbar)
                        continue;
                }
                ret = 0;
-               if (is64bit)
+             if (is64bit) {
                        *(uint64_t *)(*pbar + off) = le64_to_cpu(value64);
+                       off += 4;
+               }

                else
                        *(uint32_t *)(*pbar + off) = le32_to_cpu(value64);
        }

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

* Fwd: [PATCH] nvme-cli : fix offset advance in nvme-ioctl.c: nvme_get_properties()
  2018-06-27 17:34 ` Fwd: " Eyal BenDavid
@ 2018-06-27 17:42   ` Keith Busch
  2018-06-27 17:57     ` Eyal BenDavid
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Busch @ 2018-06-27 17:42 UTC (permalink / raw)


On Wed, Jun 27, 2018@08:34:13PM +0300, Eyal BenDavid wrote:
> In case it was missed.
> Thanks

It looks like your email client damaged your patch, turning all the tabs
to spaces. This won't apply as-is. Could you possibly resend, or send a
github pull request?
 
 
> ---------- Forwarded message ---------
> From: Eyal BenDavid <bdeyal at gmail.com>
> Date: Sun, Jun 24, 2018 at 10:37 AM
> Subject: [PATCH] nvme-cli : fix offset advance in nvme-ioctl.c:
> nvme_get_properties()
> To: linux-nvme <linux-nvme at lists.infradead.org>
> 
> 
> In the case of 64 bit property, the offset loop variable is advanced
> correctly only on error. When the call to nvme_property is successful
> (and thus err == 0) the offset variable is advanced by 4 bytes only.
> 
> Here is a small patch that fixes the offset:
> 
> diff --git i/nvme-ioctl.c w/nvme-ioctl.c
> index 63ff8fb..d52dd0a 100644
> --- i/nvme-ioctl.c
> +++ w/nvme-ioctl.c
> @@ -572,8 +572,10 @@ int nvme_get_properties(int fd, void **pbar)
>                         continue;
>                 }
>                 ret = 0;
> -               if (is64bit)
> +             if (is64bit) {
>                         *(uint64_t *)(*pbar + off) = le64_to_cpu(value64);
> +                       off += 4;
> +               }
> 
>                 else
>                         *(uint32_t *)(*pbar + off) = le32_to_cpu(value64);
>         }
> 
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Fwd: [PATCH] nvme-cli : fix offset advance in nvme-ioctl.c: nvme_get_properties()
  2018-06-27 17:42   ` Keith Busch
@ 2018-06-27 17:57     ` Eyal BenDavid
  2018-06-27 18:08       ` Keith Busch
  0 siblings, 1 reply; 5+ messages in thread
From: Eyal BenDavid @ 2018-06-27 17:57 UTC (permalink / raw)


Resend:

diff --git i/nvme-ioctl.c w/nvme-ioctl.c
index f1c7ce6..2e0abf9 100644
--- i/nvme-ioctl.c
+++ w/nvme-ioctl.c
@@ -578,8 +578,10 @@ int nvme_get_properties(int fd, void **pbar)
                        continue;
                }
                ret = 0;
-               if (is64bit)
+               if (is64bit) {
                        *(uint64_t *)(*pbar + off) = le64_to_cpu(value64);
+                       off += 4;
+               }
                else
                        *(uint32_t *)(*pbar + off) = le32_to_cpu(value64);
        }
On Wed, Jun 27, 2018@8:39 PM Keith Busch <keith.busch@linux.intel.com> wrote:
>
> On Wed, Jun 27, 2018@08:34:13PM +0300, Eyal BenDavid wrote:
> > In case it was missed.
> > Thanks
>
> It looks like your email client damaged your patch, turning all the tabs
> to spaces. This won't apply as-is. Could you possibly resend, or send a
> github pull request?
>
>
> > ---------- Forwarded message ---------
> > From: Eyal BenDavid <bdeyal at gmail.com>
> > Date: Sun, Jun 24, 2018 at 10:37 AM
> > Subject: [PATCH] nvme-cli : fix offset advance in nvme-ioctl.c:
> > nvme_get_properties()
> > To: linux-nvme <linux-nvme at lists.infradead.org>
> >
> >
> > In the case of 64 bit property, the offset loop variable is advanced
> > correctly only on error. When the call to nvme_property is successful
> > (and thus err == 0) the offset variable is advanced by 4 bytes only.
> >
> > Here is a small patch that fixes the offset:
> >
> > diff --git i/nvme-ioctl.c w/nvme-ioctl.c
> > index 63ff8fb..d52dd0a 100644
> > --- i/nvme-ioctl.c
> > +++ w/nvme-ioctl.c
> > @@ -572,8 +572,10 @@ int nvme_get_properties(int fd, void **pbar)
> >                         continue;
> >                 }
> >                 ret = 0;
> > -               if (is64bit)
> > +             if (is64bit) {
> >                         *(uint64_t *)(*pbar + off) = le64_to_cpu(value64);
> > +                       off += 4;
> > +               }
> >
> >                 else
> >                         *(uint32_t *)(*pbar + off) = le32_to_cpu(value64);
> >         }
> >
> > _______________________________________________
> > Linux-nvme mailing list
> > Linux-nvme at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Fwd: [PATCH] nvme-cli : fix offset advance in nvme-ioctl.c: nvme_get_properties()
  2018-06-27 17:57     ` Eyal BenDavid
@ 2018-06-27 18:08       ` Keith Busch
  0 siblings, 0 replies; 5+ messages in thread
From: Keith Busch @ 2018-06-27 18:08 UTC (permalink / raw)


On Wed, Jun 27, 2018@08:57:16PM +0300, Eyal BenDavid wrote:
> Resend:
> 
> diff --git i/nvme-ioctl.c w/nvme-ioctl.c
> index f1c7ce6..2e0abf9 100644
> --- i/nvme-ioctl.c
> +++ w/nvme-ioctl.c
> @@ -578,8 +578,10 @@ int nvme_get_properties(int fd, void **pbar)
>                         continue;
>                 }
>                 ret = 0;
> -               if (is64bit)
> +               if (is64bit) {
>                         *(uint64_t *)(*pbar + off) = le64_to_cpu(value64);
> +                       off += 4;
> +               }
>                 else
>                         *(uint32_t *)(*pbar + off) = le32_to_cpu(value64);
>         }

The diff is still mangled and doesn't apply.

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-24  7:37 [PATCH] nvme-cli : fix offset advance in nvme-ioctl.c: nvme_get_properties() Eyal BenDavid
2018-06-27 17:34 ` Fwd: " Eyal BenDavid
2018-06-27 17:42   ` Keith Busch
2018-06-27 17:57     ` Eyal BenDavid
2018-06-27 18:08       ` Keith Busch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.