* Re: fs/zonefs/./trace.h:22:1: sparse: sparse: cast to restricted blk_opf_t [not found] <202208061533.YBqXyzHm-lkp@intel.com> @ 2022-08-08 14:48 ` Damien Le Moal 2022-08-08 15:37 ` Bart Van Assche 0 siblings, 1 reply; 6+ messages in thread From: Damien Le Moal @ 2022-08-08 14:48 UTC (permalink / raw) To: Bart Van Assche Cc: linux-kernel, Jens Axboe, Johannes Thumshirn, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org On 2022/08/06 1:00, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: 6614a3c3164a5df2b54abb0b3559f51041cf705b > commit: e46b5970496705127f9ae494c66e0242773097e8 fs/zonefs: Use the enum req_op type for tracing request operations > date: 3 weeks ago > config: arm64-randconfig-s052-20220804 (https://download.01.org/0day-ci/archive/20220806/202208061533.YBqXyzHm-lkp@intel.com/config) > compiler: aarch64-linux-gcc (GCC) 12.1.0 > reproduce: > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # apt-get install sparse > # sparse version: v0.6.4-39-gce1a6720-dirty > # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e46b5970496705127f9ae494c66e0242773097e8 > git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > git fetch --no-tags linus master > git checkout e46b5970496705127f9ae494c66e0242773097e8 > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash fs/zonefs/ > > If you fix the issue, kindly add following tag where applicable > Reported-by: kernel test robot <lkp@intel.com> > > sparse warnings: (new ones prefixed by >>) > fs/zonefs/super.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, fs/zonefs/trace.h): >>> fs/zonefs/./trace.h:22:1: sparse: sparse: cast to restricted blk_opf_t >>> fs/zonefs/./trace.h:22:1: sparse: sparse: cast to restricted blk_opf_t >>> fs/zonefs/./trace.h:22:1: sparse: sparse: restricted blk_opf_t degrades to integer >>> fs/zonefs/./trace.h:22:1: sparse: sparse: restricted blk_opf_t degrades to integer > fs/zonefs/super.c: note: in included file (through arch/arm64/include/asm/smp.h, include/linux/smp.h, arch/arm64/include/asm/arch_timer.h, ...): > arch/arm64/include/asm/percpu.h:127:1: sparse: sparse: cast truncates bits from constant value (ffffffff becomes ff) > arch/arm64/include/asm/percpu.h:127:1: sparse: sparse: cast truncates bits from constant value (ffffffff becomes ffff) > arch/arm64/include/asm/percpu.h:127:1: sparse: sparse: cast truncates bits from constant value (ffffffff becomes ff) > arch/arm64/include/asm/percpu.h:127:1: sparse: sparse: cast truncates bits from constant value (ffffffff becomes ffff) > > vim +22 fs/zonefs/./trace.h > > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 21 > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 @22 TRACE_EVENT(zonefs_zone_mgmt, > ff07a02e9e8e64 Bart Van Assche 2022-07-14 23 TP_PROTO(struct inode *inode, enum req_op op), > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 24 TP_ARGS(inode, op), > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 25 TP_STRUCT__entry( > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 26 __field(dev_t, dev) > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 27 __field(ino_t, ino) > e46b5970496705 Bart Van Assche 2022-07-14 28 __field(enum req_op, op) > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 29 __field(sector_t, sector) > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 30 __field(sector_t, nr_sectors) > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 31 ), > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 32 TP_fast_assign( > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 33 __entry->dev = inode->i_sb->s_dev; > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 34 __entry->ino = inode->i_ino; > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 35 __entry->op = op; > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 36 __entry->sector = ZONEFS_I(inode)->i_zsector; > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 37 __entry->nr_sectors = > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 38 ZONEFS_I(inode)->i_zone_size >> SECTOR_SHIFT; > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 39 ), > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 40 TP_printk("bdev=(%d,%d), ino=%lu op=%s, sector=%llu, nr_sectors=%llu", > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 41 show_dev(__entry->dev), (unsigned long)__entry->ino, > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 42 blk_op_str(__entry->op), __entry->sector, > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 43 __entry->nr_sectors > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 44 ) > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 45 ); > 62ab1aadcccd03 Johannes Thumshirn 2021-01-27 46 Bart, Are you going to send a patch to fix this or do you want me to do it ? > > :::::: The code at line 22 was first introduced by commit > :::::: 62ab1aadcccd037a7ced4ed99b4d46d2b4190183 zonefs: add tracepoints for file operations > > :::::: TO: Johannes Thumshirn <johannes.thumshirn@wdc.com> > :::::: CC: Damien Le Moal <damien.lemoal@wdc.com> > -- Damien Le Moal Western Digital Research ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: fs/zonefs/./trace.h:22:1: sparse: sparse: cast to restricted blk_opf_t 2022-08-08 14:48 ` fs/zonefs/./trace.h:22:1: sparse: sparse: cast to restricted blk_opf_t Damien Le Moal @ 2022-08-08 15:37 ` Bart Van Assche 2022-08-10 14:36 ` Damien Le Moal 0 siblings, 1 reply; 6+ messages in thread From: Bart Van Assche @ 2022-08-08 15:37 UTC (permalink / raw) To: Damien Le Moal Cc: linux-kernel, Jens Axboe, Johannes Thumshirn, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org On 8/8/22 07:48, Damien Le Moal wrote: > Are you going to send a patch to fix this or do you want me to do it ? Hi Damien, Thanks for having taken a look. Please help with verifying whether the following patch is sufficient to fix the reported warning: "[PATCH] tracing: Suppress sparse warnings triggered by is_signed_type()" (https://lore.kernel.org/all/20220717151047.19220-1-bvanassche@acm.org/). Bart. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: fs/zonefs/./trace.h:22:1: sparse: sparse: cast to restricted blk_opf_t 2022-08-08 15:37 ` Bart Van Assche @ 2022-08-10 14:36 ` Damien Le Moal 2022-08-10 18:08 ` Bart Van Assche 0 siblings, 1 reply; 6+ messages in thread From: Damien Le Moal @ 2022-08-10 14:36 UTC (permalink / raw) To: Bart Van Assche Cc: linux-kernel, Jens Axboe, Johannes Thumshirn, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org On 2022/08/08 8:37, Bart Van Assche wrote: > On 8/8/22 07:48, Damien Le Moal wrote: >> Are you going to send a patch to fix this or do you want me to do it ? > > Hi Damien, > > Thanks for having taken a look. Please help with verifying whether the > following patch is sufficient to fix the reported warning: "[PATCH] > tracing: Suppress sparse warnings triggered by is_signed_type()" > (https://lore.kernel.org/all/20220717151047.19220-1-bvanassche@acm.org/). > > Bart. With the current Linus tree, I do not see this sparse warning. However, applying the above patch, "make M=fs/zonefs C=1" generates a lot of warnings: make -j64 M=fs/zonefs C=1 CC [M] fs/zonefs/super.o CC [M] fs/zonefs/sysfs.o CHECK fs/zonefs/sysfs.c CHECK fs/zonefs/super.c fs/zonefs/sysfs.c: note: in included file (through include/linux/bitops.h, include/linux/kernel.h, arch/x86/include/asm/percpu.h, arch/x86/include/asm/preempt.h, include/linux/preempt.h, include/linux/spinlock.h, ...): ./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return' fs/zonefs/sysfs.c: note: in included file (through include/linux/bitops.h, include/linux/kernel.h, arch/x86/include/asm/percpu.h, arch/x86/include/asm/preempt.h, include/linux/preempt.h, include/linux/spinlock.h, ...): ./include/asm-generic/bitops/generic-non-atomic.h:29:9: warning: unreplaced symbol 'mask' ./include/asm-generic/bitops/generic-non-atomic.h:30:9: warning: unreplaced symbol 'p' ./include/asm-generic/bitops/generic-non-atomic.h:32:10: warning: unreplaced symbol 'p' ./include/asm-generic/bitops/generic-non-atomic.h:32:16: warning: unreplaced symbol 'mask' ./include/asm-generic/bitops/generic-non-atomic.h:27:1: warning: unreplaced symbol 'return' fs/zonefs/sysfs.c: note: in included file (through arch/x86/include/asm/bitops.h, include/linux/bitops.h, include/linux/kernel.h, arch/x86/include/asm/percpu.h, arch/x86/include/asm/preempt.h, include/linux/preempt.h, ...): ./include/asm-generic/bitops/instrumented-non-atomic.h:26:1: warning: unreplaced symbol 'return' fs/zonefs/sysfs.c: note: in included file (through include/linux/bitops.h, include/linux/kernel.h, arch/x86/include/asm/percpu.h, arch/x86/include/asm/preempt.h, include/linux/preempt.h, include/linux/spinlock.h, ...): ./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return' fs/zonefs/sysfs.c: note: in included file (through include/linux/bitops.h, include/linux/kernel.h, arch/x86/include/asm/percpu.h, arch/x86/include/asm/preempt.h, include/linux/preempt.h, include/linux/spinlock.h, ...): ./include/asm-generic/bitops/generic-non-atomic.h:38:9: warning: unreplaced symbol 'mask' ./include/asm-generic/bitops/generic-non-atomic.h:39:9: warning: unreplaced symbol 'p' ./include/asm-generic/bitops/generic-non-atomic.h:41:10: warning: unreplaced symbol 'p' ./include/asm-generic/bitops/generic-non-atomic.h:41:16: warning: unreplaced symbol 'mask' ./include/asm-generic/bitops/generic-non-atomic.h:36:1: warning: unreplaced symbol 'return' ... Much more messages after that. -- Damien Le Moal Western Digital Research ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: fs/zonefs/./trace.h:22:1: sparse: sparse: cast to restricted blk_opf_t 2022-08-10 14:36 ` Damien Le Moal @ 2022-08-10 18:08 ` Bart Van Assche 2022-08-10 19:14 ` Damien Le Moal 0 siblings, 1 reply; 6+ messages in thread From: Bart Van Assche @ 2022-08-10 18:08 UTC (permalink / raw) To: Damien Le Moal Cc: linux-kernel, Jens Axboe, Johannes Thumshirn, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org On 8/10/22 07:36, Damien Le Moal wrote: > On 2022/08/08 8:37, Bart Van Assche wrote: >> Thanks for having taken a look. Please help with verifying whether the >> following patch is sufficient to fix the reported warning: "[PATCH] >> tracing: Suppress sparse warnings triggered by is_signed_type()" >> (https://lore.kernel.org/all/20220717151047.19220-1-bvanassche@acm.org/). > > With the current Linus tree, I do not see this sparse warning. However, applying > the above patch, "make M=fs/zonefs C=1" generates a lot of warnings: That doesn't make sense to me. My patch reduces the number of sparse warnings that are reported. > make -j64 M=fs/zonefs C=1 > CC [M] fs/zonefs/super.o > CC [M] fs/zonefs/sysfs.o > CHECK fs/zonefs/sysfs.c > CHECK fs/zonefs/super.c > fs/zonefs/sysfs.c: note: in included file (through include/linux/bitops.h, > include/linux/kernel.h, arch/x86/include/asm/percpu.h, > arch/x86/include/asm/preempt.h, include/linux/preempt.h, > include/linux/spinlock.h, ...): > ./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return' I think that you are hitting a bug in sparse. See also https://lore.kernel.org/all/e91d351c-3c16-e48d-7e9d-9f096c4acbc9@debian.org/T/. I also see the above warnings if I use the sparse binary from Debian testing. I do not see these sparse warnings if I download the sparse source code and compile that source code myself. Bart. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: fs/zonefs/./trace.h:22:1: sparse: sparse: cast to restricted blk_opf_t 2022-08-10 18:08 ` Bart Van Assche @ 2022-08-10 19:14 ` Damien Le Moal 2022-08-10 22:21 ` Bart Van Assche 0 siblings, 1 reply; 6+ messages in thread From: Damien Le Moal @ 2022-08-10 19:14 UTC (permalink / raw) To: Bart Van Assche Cc: linux-kernel, Jens Axboe, Johannes Thumshirn, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org On 2022/08/10 11:08, Bart Van Assche wrote: > On 8/10/22 07:36, Damien Le Moal wrote: >> On 2022/08/08 8:37, Bart Van Assche wrote: >>> Thanks for having taken a look. Please help with verifying whether the >>> following patch is sufficient to fix the reported warning: "[PATCH] >>> tracing: Suppress sparse warnings triggered by is_signed_type()" >>> (https://lore.kernel.org/all/20220717151047.19220-1-bvanassche@acm.org/). >> >> With the current Linus tree, I do not see this sparse warning. However, applying >> the above patch, "make M=fs/zonefs C=1" generates a lot of warnings: > > That doesn't make sense to me. My patch reduces the number of sparse > warnings that are reported. > >> make -j64 M=fs/zonefs C=1 >> CC [M] fs/zonefs/super.o >> CC [M] fs/zonefs/sysfs.o >> CHECK fs/zonefs/sysfs.c >> CHECK fs/zonefs/super.c >> fs/zonefs/sysfs.c: note: in included file (through include/linux/bitops.h, >> include/linux/kernel.h, arch/x86/include/asm/percpu.h, >> arch/x86/include/asm/preempt.h, include/linux/preempt.h, >> include/linux/spinlock.h, ...): >> ./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return' > > I think that you are hitting a bug in sparse. See also > https://lore.kernel.org/all/e91d351c-3c16-e48d-7e9d-9f096c4acbc9@debian.org/T/. > I also see the above warnings if I use the sparse binary from Debian > testing. I do not see these sparse warnings if I download the sparse > source code and compile that source code myself. Good point. I was using Fedora 36 sparse package. Using sparse compiled from source, I now see again the warnings without the patch and no warnings with the patch applied. So the patch looks good. Are you going to send it as a fix for 6.0-rc1 ? Cheers. -- Damien Le Moal Western Digital Research ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: fs/zonefs/./trace.h:22:1: sparse: sparse: cast to restricted blk_opf_t 2022-08-10 19:14 ` Damien Le Moal @ 2022-08-10 22:21 ` Bart Van Assche 0 siblings, 0 replies; 6+ messages in thread From: Bart Van Assche @ 2022-08-10 22:21 UTC (permalink / raw) To: Damien Le Moal Cc: linux-kernel, Jens Axboe, Johannes Thumshirn, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org On 8/10/22 12:14, Damien Le Moal wrote: > Good point. I was using Fedora 36 sparse package. Using sparse compiled from > source, I now see again the warnings without the patch and no warnings with the > patch applied. So the patch looks good. Are you going to send it as a fix for > 6.0-rc1 ? Hi Damien, It is not clear to me why I have not yet received any feedback from Steven Rostedt on that patch. I will try to ping Steven off-list. If necessary I will repost that patch. Best regards, Bart. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-08-10 22:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <202208061533.YBqXyzHm-lkp@intel.com>
2022-08-08 14:48 ` fs/zonefs/./trace.h:22:1: sparse: sparse: cast to restricted blk_opf_t Damien Le Moal
2022-08-08 15:37 ` Bart Van Assche
2022-08-10 14:36 ` Damien Le Moal
2022-08-10 18:08 ` Bart Van Assche
2022-08-10 19:14 ` Damien Le Moal
2022-08-10 22:21 ` Bart Van Assche
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).