linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Remove several superfluous sector casts
@ 2025-07-15 16:52 Bart Van Assche
  2025-07-15 16:52 ` [PATCH 1/5] block, bfq: Remove a superfluous cast Bart Van Assche
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Bart Van Assche @ 2025-07-15 16:52 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Christoph Hellwig, Bart Van Assche

Hi Jens,

This patch series fixes one bcache bug and removes superfluous casts of sector
numbers / offsets. Please consider this patch series for the next merge window.

Thanks,

Bart.

Bart Van Assche (5):
  block, bfq: Remove a superfluous cast
  block, genhd: Remove disk_stats.sectors casts
  bcache, tracing: Do not truncate orig_sector
  bcache, tracing: Remove superfluous casts
  block, tracing: Remove superfluous casts

 block/bfq-iosched.c           |  3 +--
 block/genhd.c                 | 12 ++++++------
 include/trace/events/bcache.h | 15 +++++++--------
 include/trace/events/block.h  | 34 +++++++++++++---------------------
 4 files changed, 27 insertions(+), 37 deletions(-)


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

* [PATCH 1/5] block, bfq: Remove a superfluous cast
  2025-07-15 16:52 [PATCH 0/5] Remove several superfluous sector casts Bart Van Assche
@ 2025-07-15 16:52 ` Bart Van Assche
  2025-07-16  1:11   ` Yu Kuai
  2025-07-15 16:52 ` [PATCH 2/5] block, genhd: Remove disk_stats.sectors casts Bart Van Assche
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Bart Van Assche @ 2025-07-15 16:52 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Christoph Hellwig, Bart Van Assche, Yu Kuai

sector_t is a synonym for u64 and all architectures define u64 as unsigned
long long. Hence, it is not necessary to cast type sector_t to unsigned
long long. Remove a superfluous cast to improve compile-time type checking.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 block/bfq-iosched.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 0cb1e9873aab..74f03bf27d82 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -769,8 +769,7 @@ bfq_rq_pos_tree_lookup(struct bfq_data *bfqd, struct rb_root *root,
 	if (rb_link)
 		*rb_link = p;
 
-	bfq_log(bfqd, "rq_pos_tree_lookup %llu: returning %d",
-		(unsigned long long)sector,
+	bfq_log(bfqd, "rq_pos_tree_lookup %llu: returning %d", sector,
 		bfqq ? bfqq->pid : 0);
 
 	return bfqq;

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

* [PATCH 2/5] block, genhd: Remove disk_stats.sectors casts
  2025-07-15 16:52 [PATCH 0/5] Remove several superfluous sector casts Bart Van Assche
  2025-07-15 16:52 ` [PATCH 1/5] block, bfq: Remove a superfluous cast Bart Van Assche
@ 2025-07-15 16:52 ` Bart Van Assche
  2025-07-15 16:52 ` [PATCH 3/5] bcache, tracing: Do not truncate orig_sector Bart Van Assche
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Bart Van Assche @ 2025-07-15 16:52 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Christoph Hellwig, Bart Van Assche

In include/linux/part_stat.h, disk_stats.sectors is declared as
unsigned long[]. Instead of casting disk_stats.sectors to unsigned long
long and formatting it with %llu, remove the cast and format these numbers
with %lu. No functionality has been changed.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 block/genhd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/block/genhd.c b/block/genhd.c
index c26733f6324b..bb78a2eb395e 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1074,19 +1074,19 @@ ssize_t part_stat_show(struct device *dev,
 	}
 	part_stat_read_all(bdev, &stat);
 	return sysfs_emit(buf,
-		"%8lu %8lu %8llu %8u "
-		"%8lu %8lu %8llu %8u "
+		"%8lu %8lu %8lu %8u "
+		"%8lu %8lu %8lu %8u "
 		"%8u %8u %8u "
-		"%8lu %8lu %8llu %8u "
+		"%8lu %8lu %8lu %8u "
 		"%8lu %8u"
 		"\n",
 		stat.ios[STAT_READ],
 		stat.merges[STAT_READ],
-		(unsigned long long)stat.sectors[STAT_READ],
+		stat.sectors[STAT_READ],
 		(unsigned int)div_u64(stat.nsecs[STAT_READ], NSEC_PER_MSEC),
 		stat.ios[STAT_WRITE],
 		stat.merges[STAT_WRITE],
-		(unsigned long long)stat.sectors[STAT_WRITE],
+		stat.sectors[STAT_WRITE],
 		(unsigned int)div_u64(stat.nsecs[STAT_WRITE], NSEC_PER_MSEC),
 		inflight,
 		jiffies_to_msecs(stat.io_ticks),
@@ -1097,7 +1097,7 @@ ssize_t part_stat_show(struct device *dev,
 						NSEC_PER_MSEC),
 		stat.ios[STAT_DISCARD],
 		stat.merges[STAT_DISCARD],
-		(unsigned long long)stat.sectors[STAT_DISCARD],
+		stat.sectors[STAT_DISCARD],
 		(unsigned int)div_u64(stat.nsecs[STAT_DISCARD], NSEC_PER_MSEC),
 		stat.ios[STAT_FLUSH],
 		(unsigned int)div_u64(stat.nsecs[STAT_FLUSH], NSEC_PER_MSEC));

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

* [PATCH 3/5] bcache, tracing: Do not truncate orig_sector
  2025-07-15 16:52 [PATCH 0/5] Remove several superfluous sector casts Bart Van Assche
  2025-07-15 16:52 ` [PATCH 1/5] block, bfq: Remove a superfluous cast Bart Van Assche
  2025-07-15 16:52 ` [PATCH 2/5] block, genhd: Remove disk_stats.sectors casts Bart Van Assche
@ 2025-07-15 16:52 ` Bart Van Assche
  2025-07-17 17:50   ` Bart Van Assche
                     ` (2 more replies)
  2025-07-15 16:52 ` [PATCH 4/5] bcache, tracing: Remove superfluous casts Bart Van Assche
                   ` (3 subsequent siblings)
  6 siblings, 3 replies; 15+ messages in thread
From: Bart Van Assche @ 2025-07-15 16:52 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Kent Overstreet,
	Steven Rostedt, Masami Hiramatsu, Kent Overstreet

Change the type of orig_sector from dev_t (unsigned int) into sector_t (u64)
to prevent truncation of orig_sector by the tracing code.

Cc: Kent Overstreet <kent.overstreet@linux.dev>
Fixes: cafe56359144 ("bcache: A block layer cache")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 include/trace/events/bcache.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h
index 899fdacf57b9..d0eee403dc15 100644
--- a/include/trace/events/bcache.h
+++ b/include/trace/events/bcache.h
@@ -16,7 +16,7 @@ DECLARE_EVENT_CLASS(bcache_request,
 		__field(unsigned int,	orig_major		)
 		__field(unsigned int,	orig_minor		)
 		__field(sector_t,	sector			)
-		__field(dev_t,		orig_sector		)
+		__field(sector_t,	orig_sector		)
 		__field(unsigned int,	nr_sector		)
 		__array(char,		rwbs,	6		)
 	),

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

* [PATCH 4/5] bcache, tracing: Remove superfluous casts
  2025-07-15 16:52 [PATCH 0/5] Remove several superfluous sector casts Bart Van Assche
                   ` (2 preceding siblings ...)
  2025-07-15 16:52 ` [PATCH 3/5] bcache, tracing: Do not truncate orig_sector Bart Van Assche
@ 2025-07-15 16:52 ` Bart Van Assche
  2025-07-23 11:25   ` Coly Li
  2025-07-15 16:52 ` [PATCH 5/5] block, " Bart Van Assche
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Bart Van Assche @ 2025-07-15 16:52 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Steven Rostedt,
	Masami Hiramatsu

sector_t is a synonym for u64 and all architectures define u64 as unsigned
long long. Hence, it is not necessary to cast type sector_t to unsigned
long long. Remove the superfluous casts to improve compile-time type checking.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 include/trace/events/bcache.h | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h
index d0eee403dc15..697e0f80d17c 100644
--- a/include/trace/events/bcache.h
+++ b/include/trace/events/bcache.h
@@ -33,9 +33,9 @@ DECLARE_EVENT_CLASS(bcache_request,
 
 	TP_printk("%d,%d %s %llu + %u (from %d,%d @ %llu)",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
-		  __entry->rwbs, (unsigned long long)__entry->sector,
+		  __entry->rwbs, __entry->sector,
 		  __entry->nr_sector, __entry->orig_major, __entry->orig_minor,
-		  (unsigned long long)__entry->orig_sector)
+		  __entry->orig_sector)
 );
 
 DECLARE_EVENT_CLASS(bkey,
@@ -107,7 +107,7 @@ DECLARE_EVENT_CLASS(bcache_bio,
 
 	TP_printk("%d,%d  %s %llu + %u",
 		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-		  (unsigned long long)__entry->sector, __entry->nr_sector)
+		  __entry->sector, __entry->nr_sector)
 );
 
 DEFINE_EVENT(bcache_bio, bcache_bypass_sequential,
@@ -144,7 +144,7 @@ TRACE_EVENT(bcache_read,
 
 	TP_printk("%d,%d  %s %llu + %u hit %u bypass %u",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
-		  __entry->rwbs, (unsigned long long)__entry->sector,
+		  __entry->rwbs, __entry->sector,
 		  __entry->nr_sector, __entry->cache_hit, __entry->bypass)
 );
 
@@ -175,7 +175,7 @@ TRACE_EVENT(bcache_write,
 
 	TP_printk("%pU inode %llu  %s %llu + %u hit %u bypass %u",
 		  __entry->uuid, __entry->inode,
-		  __entry->rwbs, (unsigned long long)__entry->sector,
+		  __entry->rwbs, __entry->sector,
 		  __entry->nr_sector, __entry->writeback, __entry->bypass)
 );
 
@@ -243,8 +243,7 @@ TRACE_EVENT(bcache_journal_write,
 
 	TP_printk("%d,%d  %s %llu + %u keys %u",
 		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-		  (unsigned long long)__entry->sector, __entry->nr_sector,
-		  __entry->nr_keys)
+		  __entry->sector, __entry->nr_sector, __entry->nr_keys)
 );
 
 /* Btree */

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

* [PATCH 5/5] block, tracing: Remove superfluous casts
  2025-07-15 16:52 [PATCH 0/5] Remove several superfluous sector casts Bart Van Assche
                   ` (3 preceding siblings ...)
  2025-07-15 16:52 ` [PATCH 4/5] bcache, tracing: Remove superfluous casts Bart Van Assche
@ 2025-07-15 16:52 ` Bart Van Assche
  2025-07-15 23:20   ` Damien Le Moal
  2025-07-23 15:09 ` [PATCH 0/5] Remove several superfluous sector casts Bart Van Assche
  2025-07-28 17:58 ` Chaitanya Kulkarni
  6 siblings, 1 reply; 15+ messages in thread
From: Bart Van Assche @ 2025-07-15 16:52 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Steven Rostedt,
	Masami Hiramatsu, Johannes Thumshirn, Chaitanya Kulkarni,
	Damien Le Moal, Ritesh Harjani (IBM)

sector_t is a synonym for u64 and all architectures define u64 as unsigned
long long. Hence, it is not necessary to cast type sector_t to unsigned
long long. Remove the superfluous casts to improve compile-time type checking.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 include/trace/events/block.h | 34 +++++++++++++---------------------
 1 file changed, 13 insertions(+), 21 deletions(-)

diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 3e582d5e3a57..af1186e8d8e3 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -41,7 +41,7 @@ DECLARE_EVENT_CLASS(block_buffer,
 
 	TP_printk("%d,%d sector=%llu size=%zu",
 		MAJOR(__entry->dev), MINOR(__entry->dev),
-		(unsigned long long)__entry->sector, __entry->size
+		__entry->sector, __entry->size
 	)
 );
 
@@ -108,7 +108,7 @@ TRACE_EVENT(block_rq_requeue,
 	TP_printk("%d,%d %s (%s) %llu + %u %s,%u,%u [%d]",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->rwbs, __get_str(cmd),
-		  (unsigned long long)__entry->sector, __entry->nr_sector,
+		  __entry->sector, __entry->nr_sector,
 		  __print_symbolic(IOPRIO_PRIO_CLASS(__entry->ioprio),
 				   IOPRIO_CLASS_STRINGS),
 		  IOPRIO_PRIO_HINT(__entry->ioprio),
@@ -145,7 +145,7 @@ DECLARE_EVENT_CLASS(block_rq_completion,
 	TP_printk("%d,%d %s (%s) %llu + %u %s,%u,%u [%d]",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->rwbs, __get_str(cmd),
-		  (unsigned long long)__entry->sector, __entry->nr_sector,
+		  __entry->sector, __entry->nr_sector,
 		  __print_symbolic(IOPRIO_PRIO_CLASS(__entry->ioprio),
 				   IOPRIO_CLASS_STRINGS),
 		  IOPRIO_PRIO_HINT(__entry->ioprio),
@@ -219,7 +219,7 @@ DECLARE_EVENT_CLASS(block_rq,
 	TP_printk("%d,%d %s %u (%s) %llu + %u %s,%u,%u [%s]",
 		  MAJOR(__entry->dev), MINOR(__entry->dev),
 		  __entry->rwbs, __entry->bytes, __get_str(cmd),
-		  (unsigned long long)__entry->sector, __entry->nr_sector,
+		  __entry->sector, __entry->nr_sector,
 		  __print_symbolic(IOPRIO_PRIO_CLASS(__entry->ioprio),
 				   IOPRIO_CLASS_STRINGS),
 		  IOPRIO_PRIO_HINT(__entry->ioprio),
@@ -328,8 +328,7 @@ TRACE_EVENT(block_bio_complete,
 
 	TP_printk("%d,%d %s %llu + %u [%d]",
 		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-		  (unsigned long long)__entry->sector,
-		  __entry->nr_sector, __entry->error)
+		  __entry->sector, __entry->nr_sector, __entry->error)
 );
 
 DECLARE_EVENT_CLASS(block_bio,
@@ -356,8 +355,7 @@ DECLARE_EVENT_CLASS(block_bio,
 
 	TP_printk("%d,%d %s %llu + %u [%s]",
 		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-		  (unsigned long long)__entry->sector,
-		  __entry->nr_sector, __entry->comm)
+		  __entry->sector, __entry->nr_sector, __entry->comm)
 );
 
 /**
@@ -509,9 +507,7 @@ TRACE_EVENT(block_split,
 
 	TP_printk("%d,%d %s %llu / %llu [%s]",
 		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-		  (unsigned long long)__entry->sector,
-		  (unsigned long long)__entry->new_sector,
-		  __entry->comm)
+		  __entry->sector, __entry->new_sector, __entry->comm)
 );
 
 /**
@@ -549,10 +545,9 @@ TRACE_EVENT(block_bio_remap,
 
 	TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
 		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-		  (unsigned long long)__entry->sector,
-		  __entry->nr_sector,
+		  __entry->sector, __entry->nr_sector,
 		  MAJOR(__entry->old_dev), MINOR(__entry->old_dev),
-		  (unsigned long long)__entry->old_sector)
+		  __entry->old_sector)
 );
 
 /**
@@ -593,10 +588,9 @@ TRACE_EVENT(block_rq_remap,
 
 	TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu %u",
 		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-		  (unsigned long long)__entry->sector,
-		  __entry->nr_sector,
+		  __entry->sector, __entry->nr_sector,
 		  MAJOR(__entry->old_dev), MINOR(__entry->old_dev),
-		  (unsigned long long)__entry->old_sector, __entry->nr_bios)
+		  __entry->old_sector, __entry->nr_bios)
 );
 
 /**
@@ -630,8 +624,7 @@ TRACE_EVENT(blkdev_zone_mgmt,
 
 	TP_printk("%d,%d %s %llu + %llu",
 		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
-		  (unsigned long long)__entry->sector,
-		  __entry->nr_sectors)
+		  __entry->sector, __entry->nr_sectors)
 );
 
 DECLARE_EVENT_CLASS(block_zwplug,
@@ -657,8 +650,7 @@ DECLARE_EVENT_CLASS(block_zwplug,
 
 	TP_printk("%d,%d zone %u, BIO %llu + %u",
 		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->zno,
-		  (unsigned long long)__entry->sector,
-		  __entry->nr_sectors)
+		  __entry->sector, __entry->nr_sectors)
 );
 
 DEFINE_EVENT(block_zwplug, disk_zone_wplug_add_bio,

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

* Re: [PATCH 5/5] block, tracing: Remove superfluous casts
  2025-07-15 16:52 ` [PATCH 5/5] block, " Bart Van Assche
@ 2025-07-15 23:20   ` Damien Le Moal
  0 siblings, 0 replies; 15+ messages in thread
From: Damien Le Moal @ 2025-07-15 23:20 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, Christoph Hellwig, Steven Rostedt, Masami Hiramatsu,
	Johannes Thumshirn, Chaitanya Kulkarni, Ritesh Harjani (IBM)

On 7/16/25 01:52, Bart Van Assche wrote:
> sector_t is a synonym for u64 and all architectures define u64 as unsigned
> long long. Hence, it is not necessary to cast type sector_t to unsigned
> long long. Remove the superfluous casts to improve compile-time type checking.
> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

-- 
Damien Le Moal
Western Digital Research

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

* Re: [PATCH 1/5] block, bfq: Remove a superfluous cast
  2025-07-15 16:52 ` [PATCH 1/5] block, bfq: Remove a superfluous cast Bart Van Assche
@ 2025-07-16  1:11   ` Yu Kuai
  0 siblings, 0 replies; 15+ messages in thread
From: Yu Kuai @ 2025-07-16  1:11 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe; +Cc: linux-block, Christoph Hellwig, yukuai (C)

在 2025/07/16 0:52, Bart Van Assche 写道:
> sector_t is a synonym for u64 and all architectures define u64 as unsigned
> long long. Hence, it is not necessary to cast type sector_t to unsigned
> long long. Remove a superfluous cast to improve compile-time type checking.
> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>   block/bfq-iosched.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 

Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Thanks
> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
> index 0cb1e9873aab..74f03bf27d82 100644
> --- a/block/bfq-iosched.c
> +++ b/block/bfq-iosched.c
> @@ -769,8 +769,7 @@ bfq_rq_pos_tree_lookup(struct bfq_data *bfqd, struct rb_root *root,
>   	if (rb_link)
>   		*rb_link = p;
>   
> -	bfq_log(bfqd, "rq_pos_tree_lookup %llu: returning %d",
> -		(unsigned long long)sector,
> +	bfq_log(bfqd, "rq_pos_tree_lookup %llu: returning %d", sector,
>   		bfqq ? bfqq->pid : 0);
>   
>   	return bfqq;
> .
> 


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

* Re: [PATCH 3/5] bcache, tracing: Do not truncate orig_sector
  2025-07-15 16:52 ` [PATCH 3/5] bcache, tracing: Do not truncate orig_sector Bart Van Assche
@ 2025-07-17 17:50   ` Bart Van Assche
  2025-07-22 17:54   ` Bart Van Assche
  2025-07-23 11:24   ` Coly Li
  2 siblings, 0 replies; 15+ messages in thread
From: Bart Van Assche @ 2025-07-17 17:50 UTC (permalink / raw)
  To: colyli
  Cc: Jens Axboe, linux-block, Christoph Hellwig, Kent Overstreet,
	Steven Rostedt, Masami Hiramatsu, Kent Overstreet

On 7/15/25 9:52 AM, Bart Van Assche wrote:
> Change the type of orig_sector from dev_t (unsigned int) into sector_t (u64)
> to prevent truncation of orig_sector by the tracing code.
> 
> Cc: Kent Overstreet <kent.overstreet@linux.dev>
> Fixes: cafe56359144 ("bcache: A block layer cache")
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>   include/trace/events/bcache.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h
> index 899fdacf57b9..d0eee403dc15 100644
> --- a/include/trace/events/bcache.h
> +++ b/include/trace/events/bcache.h
> @@ -16,7 +16,7 @@ DECLARE_EVENT_CLASS(bcache_request,
>   		__field(unsigned int,	orig_major		)
>   		__field(unsigned int,	orig_minor		)
>   		__field(sector_t,	sector			)
> -		__field(dev_t,		orig_sector		)
> +		__field(sector_t,	orig_sector		)
>   		__field(unsigned int,	nr_sector		)
>   		__array(char,		rwbs,	6		)
>   	),

Hi Coly,

Can you please help with reviewing the two bcache patches in this patch
series? Apparently you didn't get Cc-ed automatically by
scripts/get_maintainer.pl. See also
https://lore.kernel.org/linux-block/20250715165249.1024639-1-bvanassche@acm.org/.

Thanks,

Bart.

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

* Re: [PATCH 3/5] bcache, tracing: Do not truncate orig_sector
  2025-07-15 16:52 ` [PATCH 3/5] bcache, tracing: Do not truncate orig_sector Bart Van Assche
  2025-07-17 17:50   ` Bart Van Assche
@ 2025-07-22 17:54   ` Bart Van Assche
  2025-07-23 11:26     ` Coly Li
  2025-07-23 11:24   ` Coly Li
  2 siblings, 1 reply; 15+ messages in thread
From: Bart Van Assche @ 2025-07-22 17:54 UTC (permalink / raw)
  To: Coly Li
  Cc: Jens Axboe, linux-block, Christoph Hellwig, Kent Overstreet,
	Steven Rostedt, Masami Hiramatsu, Kent Overstreet

On 7/15/25 9:52 AM, Bart Van Assche wrote:
> Change the type of orig_sector from dev_t (unsigned int) into sector_t (u64)
> to prevent truncation of orig_sector by the tracing code.
> 
> Cc: Kent Overstreet <kent.overstreet@linux.dev>
> Fixes: cafe56359144 ("bcache: A block layer cache")
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>   include/trace/events/bcache.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h
> index 899fdacf57b9..d0eee403dc15 100644
> --- a/include/trace/events/bcache.h
> +++ b/include/trace/events/bcache.h
> @@ -16,7 +16,7 @@ DECLARE_EVENT_CLASS(bcache_request,
>   		__field(unsigned int,	orig_major		)
>   		__field(unsigned int,	orig_minor		)
>   		__field(sector_t,	sector			)
> -		__field(dev_t,		orig_sector		)
> +		__field(sector_t,	orig_sector		)
>   		__field(unsigned int,	nr_sector		)
>   		__array(char,		rwbs,	6		)
>   	),

Hi Coly,

Can you please help with reviewing the two bcache patches in this patch
series? Apparently you didn't get Cc-ed automatically by
scripts/get_maintainer.pl. See also
https://lore.kernel.org/linux-block/20250715165249.1024639-1-bvanassche@acm.org/.

Thanks,

Bart.

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

* Re: [PATCH 3/5] bcache, tracing: Do not truncate orig_sector
  2025-07-15 16:52 ` [PATCH 3/5] bcache, tracing: Do not truncate orig_sector Bart Van Assche
  2025-07-17 17:50   ` Bart Van Assche
  2025-07-22 17:54   ` Bart Van Assche
@ 2025-07-23 11:24   ` Coly Li
  2 siblings, 0 replies; 15+ messages in thread
From: Coly Li @ 2025-07-23 11:24 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Jens Axboe, linux-block, Christoph Hellwig, Kent Overstreet,
	Steven Rostedt, Masami Hiramatsu, Kent Overstreet

On Tue, Jul 15, 2025 at 09:52:37AM +0800, Bart Van Assche wrote:
> Change the type of orig_sector from dev_t (unsigned int) into sector_t (u64)
> to prevent truncation of orig_sector by the tracing code.
> 
> Cc: Kent Overstreet <kent.overstreet@linux.dev>
> Fixes: cafe56359144 ("bcache: A block layer cache")
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Acked-by: Coly Li <colyli@kernel.org>

Thanks.

Coly Li

> ---
>  include/trace/events/bcache.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h
> index 899fdacf57b9..d0eee403dc15 100644
> --- a/include/trace/events/bcache.h
> +++ b/include/trace/events/bcache.h
> @@ -16,7 +16,7 @@ DECLARE_EVENT_CLASS(bcache_request,
>  		__field(unsigned int,	orig_major		)
>  		__field(unsigned int,	orig_minor		)
>  		__field(sector_t,	sector			)
> -		__field(dev_t,		orig_sector		)
> +		__field(sector_t,	orig_sector		)
>  		__field(unsigned int,	nr_sector		)
>  		__array(char,		rwbs,	6		)
>  	),
> 

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

* Re: [PATCH 4/5] bcache, tracing: Remove superfluous casts
  2025-07-15 16:52 ` [PATCH 4/5] bcache, tracing: Remove superfluous casts Bart Van Assche
@ 2025-07-23 11:25   ` Coly Li
  0 siblings, 0 replies; 15+ messages in thread
From: Coly Li @ 2025-07-23 11:25 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Jens Axboe, linux-block, Christoph Hellwig, Steven Rostedt,
	Masami Hiramatsu

On Tue, Jul 15, 2025 at 09:52:38AM +0800, Bart Van Assche wrote:
> sector_t is a synonym for u64 and all architectures define u64 as unsigned
> long long. Hence, it is not necessary to cast type sector_t to unsigned
> long long. Remove the superfluous casts to improve compile-time type checking.
> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Acked-by: Coly Li <colyli@kernel.org>

Thanks.

Coly Li

> ---
>  include/trace/events/bcache.h | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h
> index d0eee403dc15..697e0f80d17c 100644
> --- a/include/trace/events/bcache.h
> +++ b/include/trace/events/bcache.h
> @@ -33,9 +33,9 @@ DECLARE_EVENT_CLASS(bcache_request,
>  
>  	TP_printk("%d,%d %s %llu + %u (from %d,%d @ %llu)",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
> -		  __entry->rwbs, (unsigned long long)__entry->sector,
> +		  __entry->rwbs, __entry->sector,
>  		  __entry->nr_sector, __entry->orig_major, __entry->orig_minor,
> -		  (unsigned long long)__entry->orig_sector)
> +		  __entry->orig_sector)
>  );
>  
>  DECLARE_EVENT_CLASS(bkey,
> @@ -107,7 +107,7 @@ DECLARE_EVENT_CLASS(bcache_bio,
>  
>  	TP_printk("%d,%d  %s %llu + %u",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
> -		  (unsigned long long)__entry->sector, __entry->nr_sector)
> +		  __entry->sector, __entry->nr_sector)
>  );
>  
>  DEFINE_EVENT(bcache_bio, bcache_bypass_sequential,
> @@ -144,7 +144,7 @@ TRACE_EVENT(bcache_read,
>  
>  	TP_printk("%d,%d  %s %llu + %u hit %u bypass %u",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev),
> -		  __entry->rwbs, (unsigned long long)__entry->sector,
> +		  __entry->rwbs, __entry->sector,
>  		  __entry->nr_sector, __entry->cache_hit, __entry->bypass)
>  );
>  
> @@ -175,7 +175,7 @@ TRACE_EVENT(bcache_write,
>  
>  	TP_printk("%pU inode %llu  %s %llu + %u hit %u bypass %u",
>  		  __entry->uuid, __entry->inode,
> -		  __entry->rwbs, (unsigned long long)__entry->sector,
> +		  __entry->rwbs, __entry->sector,
>  		  __entry->nr_sector, __entry->writeback, __entry->bypass)
>  );
>  
> @@ -243,8 +243,7 @@ TRACE_EVENT(bcache_journal_write,
>  
>  	TP_printk("%d,%d  %s %llu + %u keys %u",
>  		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
> -		  (unsigned long long)__entry->sector, __entry->nr_sector,
> -		  __entry->nr_keys)
> +		  __entry->sector, __entry->nr_sector, __entry->nr_keys)
>  );
>  
>  /* Btree */
> 

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

* Re: [PATCH 3/5] bcache, tracing: Do not truncate orig_sector
  2025-07-22 17:54   ` Bart Van Assche
@ 2025-07-23 11:26     ` Coly Li
  0 siblings, 0 replies; 15+ messages in thread
From: Coly Li @ 2025-07-23 11:26 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Jens Axboe, linux-block, Christoph Hellwig, Kent Overstreet,
	Steven Rostedt, Masami Hiramatsu, Kent Overstreet

On Tue, Jul 22, 2025 at 10:54:02AM +0800, Bart Van Assche wrote:
> On 7/15/25 9:52 AM, Bart Van Assche wrote:
> > Change the type of orig_sector from dev_t (unsigned int) into sector_t (u64)
> > to prevent truncation of orig_sector by the tracing code.
> > 
> > Cc: Kent Overstreet <kent.overstreet@linux.dev>
> > Fixes: cafe56359144 ("bcache: A block layer cache")
> > Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> > ---
> >   include/trace/events/bcache.h | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h
> > index 899fdacf57b9..d0eee403dc15 100644
> > --- a/include/trace/events/bcache.h
> > +++ b/include/trace/events/bcache.h
> > @@ -16,7 +16,7 @@ DECLARE_EVENT_CLASS(bcache_request,
> >   		__field(unsigned int,	orig_major		)
> >   		__field(unsigned int,	orig_minor		)
> >   		__field(sector_t,	sector			)
> > -		__field(dev_t,		orig_sector		)
> > +		__field(sector_t,	orig_sector		)
> >   		__field(unsigned int,	nr_sector		)
> >   		__array(char,		rwbs,	6		)
> >   	),
> 
> Hi Coly,
> 
> Can you please help with reviewing the two bcache patches in this patch
> series? Apparently you didn't get Cc-ed automatically by
> scripts/get_maintainer.pl. See also
> https://lore.kernel.org/linux-block/20250715165249.1024639-1-bvanassche@acm.org/.

Done. Thanks.

Coly Li

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

* Re: [PATCH 0/5] Remove several superfluous sector casts
  2025-07-15 16:52 [PATCH 0/5] Remove several superfluous sector casts Bart Van Assche
                   ` (4 preceding siblings ...)
  2025-07-15 16:52 ` [PATCH 5/5] block, " Bart Van Assche
@ 2025-07-23 15:09 ` Bart Van Assche
  2025-07-28 17:58 ` Chaitanya Kulkarni
  6 siblings, 0 replies; 15+ messages in thread
From: Bart Van Assche @ 2025-07-23 15:09 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Christoph Hellwig

On 7/15/25 9:52 AM, Bart Van Assche wrote:
> This patch series fixes one bcache bug and removes superfluous casts of sector
> numbers / offsets. Please consider this patch series for the next merge window.

(replying to my own e-mail)

Hi Jens,

Do you agree that this patch series is low risk and that it is ready to
be merged?

Thanks,

Bart.

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

* Re: [PATCH 0/5] Remove several superfluous sector casts
  2025-07-15 16:52 [PATCH 0/5] Remove several superfluous sector casts Bart Van Assche
                   ` (5 preceding siblings ...)
  2025-07-23 15:09 ` [PATCH 0/5] Remove several superfluous sector casts Bart Van Assche
@ 2025-07-28 17:58 ` Chaitanya Kulkarni
  6 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2025-07-28 17:58 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block@vger.kernel.org, Christoph Hellwig

On 7/15/25 09:52, Bart Van Assche wrote:
> Hi Jens,
>
> This patch series fixes one bcache bug and removes superfluous casts of sector
> numbers / offsets. Please consider this patch series for the next merge window.
>
> Thanks,
>
> Bart.

For the whole series, looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



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

end of thread, other threads:[~2025-07-28 17:58 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15 16:52 [PATCH 0/5] Remove several superfluous sector casts Bart Van Assche
2025-07-15 16:52 ` [PATCH 1/5] block, bfq: Remove a superfluous cast Bart Van Assche
2025-07-16  1:11   ` Yu Kuai
2025-07-15 16:52 ` [PATCH 2/5] block, genhd: Remove disk_stats.sectors casts Bart Van Assche
2025-07-15 16:52 ` [PATCH 3/5] bcache, tracing: Do not truncate orig_sector Bart Van Assche
2025-07-17 17:50   ` Bart Van Assche
2025-07-22 17:54   ` Bart Van Assche
2025-07-23 11:26     ` Coly Li
2025-07-23 11:24   ` Coly Li
2025-07-15 16:52 ` [PATCH 4/5] bcache, tracing: Remove superfluous casts Bart Van Assche
2025-07-23 11:25   ` Coly Li
2025-07-15 16:52 ` [PATCH 5/5] block, " Bart Van Assche
2025-07-15 23:20   ` Damien Le Moal
2025-07-23 15:09 ` [PATCH 0/5] Remove several superfluous sector casts Bart Van Assche
2025-07-28 17:58 ` Chaitanya Kulkarni

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).