* [PATCH] lightnvm: assume 64-bit lba numbers
@ 2017-04-19 17:39 Arnd Bergmann
2017-04-19 18:04 ` Matias Bjørling
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2017-04-19 17:39 UTC (permalink / raw)
To: Matias Bjorling
Cc: Arnd Bergmann, Matias Bjørling, Javier González,
Jens Axboe, linux-block, linux-kernel
The driver uses both u64 and sector_t to refer to offsets, and assigns between the
two. This causes one harmless warning when sector_t is 32-bit:
drivers/lightnvm/pblk-rb.c: In function 'pblk_rb_write_entry_gc':
include/linux/lightnvm.h:215:20: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
drivers/lightnvm/pblk-rb.c:324:22: note: in expansion of macro 'ADDR_EMPTY'
As the driver is already doing this inconsistently, changing the type
won't make it worse and is an easy way to avoid the warning.
Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/lightnvm/pblk.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h
index c82120ce3be5..11ed7d83f572 100644
--- a/drivers/lightnvm/pblk.h
+++ b/drivers/lightnvm/pblk.h
@@ -119,7 +119,7 @@ struct pblk_w_ctx {
struct bio_list bios; /* Original bios - used for completion
* in REQ_FUA, REQ_FLUSH case
*/
- sector_t lba; /* Logic addr. associated with entry */
+ u64 lba; /* Logic addr. associated with entry */
struct ppa_addr ppa; /* Physic addr. associated with entry */
int flags; /* Write context flags */
};
--
2.9.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] lightnvm: assume 64-bit lba numbers
2017-04-19 17:39 [PATCH] lightnvm: assume 64-bit lba numbers Arnd Bergmann
@ 2017-04-19 18:04 ` Matias Bjørling
2017-04-19 18:08 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: Matias Bjørling @ 2017-04-19 18:04 UTC (permalink / raw)
To: Arnd Bergmann, Matias Bjorling
Cc: Javier González, Jens Axboe, linux-block, linux-kernel
On 04/19/2017 07:39 PM, Arnd Bergmann wrote:
> The driver uses both u64 and sector_t to refer to offsets, and assigns between the
> two. This causes one harmless warning when sector_t is 32-bit:
>
> drivers/lightnvm/pblk-rb.c: In function 'pblk_rb_write_entry_gc':
> include/linux/lightnvm.h:215:20: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
> drivers/lightnvm/pblk-rb.c:324:22: note: in expansion of macro 'ADDR_EMPTY'
>
> As the driver is already doing this inconsistently, changing the type
> won't make it worse and is an easy way to avoid the warning.
>
> Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/lightnvm/pblk.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h
> index c82120ce3be5..11ed7d83f572 100644
> --- a/drivers/lightnvm/pblk.h
> +++ b/drivers/lightnvm/pblk.h
> @@ -119,7 +119,7 @@ struct pblk_w_ctx {
> struct bio_list bios; /* Original bios - used for completion
> * in REQ_FUA, REQ_FLUSH case
> */
> - sector_t lba; /* Logic addr. associated with entry */
> + u64 lba; /* Logic addr. associated with entry */
> struct ppa_addr ppa; /* Physic addr. associated with entry */
> int flags; /* Write context flags */
> };
>
Thanks Arnd. Jens, could you pick this up? Thank you
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] lightnvm: assume 64-bit lba numbers
2017-04-19 18:04 ` Matias Bjørling
@ 2017-04-19 18:08 ` Jens Axboe
0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2017-04-19 18:08 UTC (permalink / raw)
To: Matias Bjørling, Arnd Bergmann, Matias Bjorling
Cc: Javier González, linux-block, linux-kernel
On 04/19/2017 12:04 PM, Matias Bjørling wrote:
> On 04/19/2017 07:39 PM, Arnd Bergmann wrote:
>> The driver uses both u64 and sector_t to refer to offsets, and assigns between the
>> two. This causes one harmless warning when sector_t is 32-bit:
>>
>> drivers/lightnvm/pblk-rb.c: In function 'pblk_rb_write_entry_gc':
>> include/linux/lightnvm.h:215:20: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
>> drivers/lightnvm/pblk-rb.c:324:22: note: in expansion of macro 'ADDR_EMPTY'
>>
>> As the driver is already doing this inconsistently, changing the type
>> won't make it worse and is an easy way to avoid the warning.
>>
>> Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>> drivers/lightnvm/pblk.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h
>> index c82120ce3be5..11ed7d83f572 100644
>> --- a/drivers/lightnvm/pblk.h
>> +++ b/drivers/lightnvm/pblk.h
>> @@ -119,7 +119,7 @@ struct pblk_w_ctx {
>> struct bio_list bios; /* Original bios - used for completion
>> * in REQ_FUA, REQ_FLUSH case
>> */
>> - sector_t lba; /* Logic addr. associated with entry */
>> + u64 lba; /* Logic addr. associated with entry */
>> struct ppa_addr ppa; /* Physic addr. associated with entry */
>> int flags; /* Write context flags */
>> };
>>
>
> Thanks Arnd. Jens, could you pick this up? Thank you
Done, thanks Arnd.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-19 18:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-19 17:39 [PATCH] lightnvm: assume 64-bit lba numbers Arnd Bergmann
2017-04-19 18:04 ` Matias Bjørling
2017-04-19 18:08 ` Jens Axboe
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).