nvme-cli : fix offset advance in nvme-ioctl.c: nvme_get_properties()
PATCH 1/1 nvme-cli : fix offset advance in nvme-ioctl.c: nvme_get_properties()
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:
nvme-ioctl.c +3 -1
@@ -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);
}
PATCH 1/1 nvme-cli : fix offset advance in nvme-ioctl.c: nvme_get_properties()
In case it was missed.
Thanks
---------- Forwarded message ---------
From: Eyal BenDavid <[email protected]>
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:
nvme-ioctl.c +3 -1
@@ -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);
}
PATCH 1/1 nvme-cli : fix offset advance in nvme-ioctl.c: nvme_get_properties()
Quoted 2 lines · Eyal BenDavid
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?
Quoted 36 lines
---------- 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 innvme-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_propertyis successful (and thus err == 0) the offset variable is advanced by 4 bytes only.Here is a small patch that fixes the offset:
nvme-ioctl.c +3
-1@@ -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
PATCH 1/1 nvme-cli : fix offset advance in nvme-ioctl.c: nvme_get_properties()
Resend:
nvme-ioctl.c +3 -1
@@ -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); }
Quoted 46 lines · Keith Busch
Quoted 2 lines · Eyal BenDavid
In case it was missed.
ThanksIt 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?
Quoted 36 lines
---------- 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 innvme-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_propertyis successful (and thus err == 0) the offset variable is advanced by 4 bytes only.Here is a small patch that fixes the offset:
nvme-ioctl.c +3
-1@@ -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
PATCH 1/1 nvme-cli : fix offset advance in nvme-ioctl.c: nvme_get_properties()
Quoted 8 lines · Eyal BenDavid
Resend:
nvme-ioctl.c +0
-0@@ -578,8 +578,10 @@ int nvme_get_properties(int fd, void **pbar)continue ;
nvme-ioctl.c int nvme_get_properties(int fd, void **pbar) · line 587
Quoted 10 lines
nvme-ioctl.c +3
-1} 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.