tree: https://github.com/ammarfaizi2/linux-block axboe/linux-block/perf-wip.2 head: 53c6dc373fcb6f58ae3dcda07c99fc1e70e1c923 commit: 5c577ab91b0cc2c14cc4074fb020a948176c4453 [2/14] block: optimise submit_bio_checks for normal rw config: nios2-randconfig-s043-20221218 compiler: nios2-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://github.com/ammarfaizi2/linux-block/commit/5c577ab91b0cc2c14cc4074fb020a948176c4453 git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block git fetch --no-tags ammarfaizi2-block axboe/linux-block/perf-wip.2 git checkout 5c577ab91b0cc2c14cc4074fb020a948176c4453 # 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=nios2 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=nios2 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> block/blk-core.c:759:12: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int op @@ got restricted blk_opf_t enum req_op @@ block/blk-core.c:759:12: sparse: expected unsigned int op block/blk-core.c:759:12: sparse: got restricted blk_opf_t enum req_op >> block/blk-core.c:760:19: sparse: sparse: restricted blk_opf_t degrades to integer block/blk-core.c:760:40: sparse: sparse: restricted blk_opf_t degrades to integer block/blk-core.c:760:62: sparse: sparse: restricted blk_opf_t degrades to integer block/blk-core.c:762:22: sparse: sparse: restricted blk_opf_t degrades to integer block/blk-core.c:766:22: sparse: sparse: restricted blk_opf_t degrades to integer block/blk-core.c:770:22: sparse: sparse: restricted blk_opf_t degrades to integer block/blk-core.c:775:22: sparse: sparse: restricted blk_opf_t degrades to integer block/blk-core.c:776:22: sparse: sparse: restricted blk_opf_t degrades to integer block/blk-core.c:777:22: sparse: sparse: restricted blk_opf_t degrades to integer block/blk-core.c:778:22: sparse: sparse: restricted blk_opf_t degrades to integer block/blk-core.c:782:22: sparse: sparse: restricted blk_opf_t degrades to integer block/blk-core.c:787:22: sparse: sparse: restricted blk_opf_t degrades to integer vim +759 block/blk-core.c 702 703 /** 704 * submit_bio_noacct - re-submit a bio to the block device layer for I/O 705 * @bio: The bio describing the location in memory and on the device. 706 * 707 * This is a version of submit_bio() that shall only be used for I/O that is 708 * resubmitted to lower level drivers by stacking block drivers. All file 709 * systems and other upper level users of the block layer should use 710 * submit_bio() instead. 711 */ 712 void submit_bio_noacct(struct bio *bio) 713 { 714 struct block_device *bdev = bio->bi_bdev; 715 struct request_queue *q = bdev_get_queue(bdev); 716 blk_status_t status = BLK_STS_IOERR; 717 struct blk_plug *plug; 718 unsigned op; 719 720 might_sleep(); 721 722 plug = blk_mq_plug(bio); 723 if (plug && plug->nowait) 724 bio->bi_opf |= REQ_NOWAIT; 725 726 /* 727 * For a REQ_NOWAIT based request, return -EOPNOTSUPP 728 * if queue does not support NOWAIT. 729 */ 730 if ((bio->bi_opf & REQ_NOWAIT) && !bdev_nowait(bdev)) 731 goto not_supported; 732 733 if (should_fail_bio(bio)) 734 goto end_io; 735 bio_check_ro(bio); 736 if (!bio_flagged(bio, BIO_REMAPPED)) { 737 if (unlikely(bio_check_eod(bio))) 738 goto end_io; 739 if (bdev->bd_partno && unlikely(blk_partition_remap(bio))) 740 goto end_io; 741 } 742 743 /* 744 * Filter flush bio's early so that bio based drivers without flush 745 * support don't have to worry about them. 746 */ 747 if (op_is_flush(bio->bi_opf) && 748 !test_bit(QUEUE_FLAG_WC, &q->queue_flags)) { 749 bio->bi_opf &= ~(REQ_PREFLUSH | REQ_FUA); 750 if (!bio_sectors(bio)) { 751 status = BLK_STS_OK; 752 goto end_io; 753 } 754 } 755 756 if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags)) 757 bio_clear_polled(bio); 758 > 759 op = bio_op(bio); > 760 if (op != REQ_OP_READ && op != REQ_OP_WRITE && op != REQ_OP_FLUSH) { 761 switch (op) { 762 case REQ_OP_DISCARD: 763 if (!bdev_max_discard_sectors(bdev)) 764 goto not_supported; 765 break; 766 case REQ_OP_SECURE_ERASE: 767 if (!bdev_max_secure_erase_sectors(bdev)) 768 goto not_supported; 769 break; 770 case REQ_OP_ZONE_APPEND: 771 status = blk_check_zone_append(q, bio); 772 if (status != BLK_STS_OK) 773 goto end_io; 774 break; 775 case REQ_OP_ZONE_RESET: 776 case REQ_OP_ZONE_OPEN: 777 case REQ_OP_ZONE_CLOSE: 778 case REQ_OP_ZONE_FINISH: 779 if (!bdev_is_zoned(bio->bi_bdev)) 780 goto not_supported; 781 break; 782 case REQ_OP_ZONE_RESET_ALL: 783 if (!bdev_is_zoned(bio->bi_bdev) || 784 !blk_queue_zone_resetall(q)) 785 goto not_supported; 786 break; 787 case REQ_OP_WRITE_ZEROES: 788 if (!q->limits.max_write_zeroes_sectors) 789 goto not_supported; 790 break; 791 default: 792 break; 793 } 794 } 795 796 if (blk_throtl_bio(bio)) 797 return; 798 799 blk_cgroup_bio_start(bio); 800 blkcg_bio_issue_init(bio); 801 802 if (!bio_flagged(bio, BIO_TRACE_COMPLETION)) { 803 trace_block_bio_queue(bio); 804 /* Now that enqueuing has been traced, we need to trace 805 * completion as well. 806 */ 807 bio_set_flag(bio, BIO_TRACE_COMPLETION); 808 } 809 submit_bio_noacct_nocheck(bio); 810 return; 811 812 not_supported: 813 status = BLK_STS_NOTSUPP; 814 end_io: 815 bio->bi_status = status; 816 bio_endio(bio); 817 } 818 EXPORT_SYMBOL(submit_bio_noacct); 819 -- 0-DAY CI Kernel Test Service https://01.org/lkp