Re: [PATCH -mm 1/2] nilfs2: use integer type instead of enum req_op for event tracing header

From: Ryusuke Konishi
Date: Sun May 05 2024 - 15:05:25 EST


On Sun, May 5, 2024 at 9:47 PM Bart Van Assche wrote:
>
> On 5/2/24 12:01 PM, Ryusuke Konishi wrote:
> > If you haven't given up yet on solving the underlying problem, I would
> > like to withdraw this patch.
>
> Has this untested change been considered?
>
> diff --git a/include/trace/events/nilfs2.h b/include/trace/events/nilfs2.h
> index 8efc6236f57c..67fd2e002ca7 100644
> --- a/include/trace/events/nilfs2.h
> +++ b/include/trace/events/nilfs2.h
> @@ -214,7 +214,7 @@ TRACE_EVENT(nilfs2_mdt_submit_block,
> __entry->inode,
> __entry->ino,
> __entry->blkoff,
> - __entry->mode)
> + (__force u32)__entry->mode)
> );
>
> #endif /* _TRACE_NILFS2_H */

No, I didn't think of that. There was no warning in TP_printk()
declaration of the nilfs2_mdt_submit_block trace point.

If you suggested this as an alternative idea, unfortunately the
following warnings are still output:

CC [M] fs/nilfs2/segment.o
CHECK fs/nilfs2/segment.c
fs/nilfs2/segment.c: note: in included file (through
include/trace/trace_events.h, include/trace/define_trace.h,
include/trace/events/nilfs2.h):
/include/trace/events/nilfs2.h:191:1: warning: cast to restricted blk_opf_t
/include/trace/events/nilfs2.h:191:1: warning: restricted blk_opf_t
degrades to integer
/include/trace/events/nilfs2.h:191:1: warning: restricted blk_opf_t
degrades to integer

I also tried typecasting on the declaration header side of event
tracing, but so far, the sparse warnings don't go away except for the
patch I first proposed.

But, better suggestions or solutions to the underlying problem are welcome.
(Again, should we put the patch on hold?)

Regards,
Ryusuke Konishi