lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202207141000.WZs97iNH-lkp@intel.com>
Date:   Thu, 14 Jul 2022 10:41:24 +0800
From:   kernel test robot <lkp@...el.com>
To:     Bart Van Assche <bvanassche@....org>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Sagi Grimberg <sagi@...mberg.me>
Subject: [bvanassche:block-bitwise-opf 38/64]
 drivers/nvme/target/zns.c:528:25: warning: unused variable 'opf'

tree:   https://github.com/bvanassche/linux block-bitwise-opf
head:   a18eedf7d10c719e2da2a802964f8aaade09e72c
commit: 5d612f7990f6438fe5d09c30560c0e25a1d292a2 [38/64] nvme/target: Use the new blk_opf_t type
config: i386-randconfig-a005 (https://download.01.org/0day-ci/archive/20220714/202207141000.WZs97iNH-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/bvanassche/linux/commit/5d612f7990f6438fe5d09c30560c0e25a1d292a2
        git remote add bvanassche https://github.com/bvanassche/linux
        git fetch --no-tags bvanassche block-bitwise-opf
        git checkout 5d612f7990f6438fe5d09c30560c0e25a1d292a2
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/nvme/target/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   drivers/nvme/target/zns.c: In function 'nvmet_bdev_execute_zone_append':
   drivers/nvme/target/zns.c:559:56: error: 'op' undeclared (first use in this function); did you mean 'opf'?
     559 |                          ARRAY_SIZE(req->inline_bvec), op);
         |                                                        ^~
         |                                                        opf
   drivers/nvme/target/zns.c:559:56: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/nvme/target/zns.c:528:25: warning: unused variable 'opf' [-Wunused-variable]
     528 |         const blk_opf_t opf = REQ_OP_ZONE_APPEND | REQ_SYNC | REQ_IDLE;
         |                         ^~~


vim +/opf +528 drivers/nvme/target/zns.c

   524	
   525	void nvmet_bdev_execute_zone_append(struct nvmet_req *req)
   526	{
   527		sector_t sect = nvmet_lba_to_sect(req->ns, req->cmd->rw.slba);
 > 528		const blk_opf_t opf = REQ_OP_ZONE_APPEND | REQ_SYNC | REQ_IDLE;
   529		u16 status = NVME_SC_SUCCESS;
   530		unsigned int total_len = 0;
   531		struct scatterlist *sg;
   532		struct bio *bio;
   533		int sg_cnt;
   534	
   535		/* Request is completed on len mismatch in nvmet_check_transter_len() */
   536		if (!nvmet_check_transfer_len(req, nvmet_rw_data_len(req)))
   537			return;
   538	
   539		if (!req->sg_cnt) {
   540			nvmet_req_complete(req, 0);
   541			return;
   542		}
   543	
   544		if (sect >= get_capacity(req->ns->bdev->bd_disk)) {
   545			req->error_loc = offsetof(struct nvme_rw_command, slba);
   546			status = NVME_SC_LBA_RANGE | NVME_SC_DNR;
   547			goto out;
   548		}
   549	
   550		if (sect & (bdev_zone_sectors(req->ns->bdev) - 1)) {
   551			req->error_loc = offsetof(struct nvme_rw_command, slba);
   552			status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
   553			goto out;
   554		}
   555	
   556		if (nvmet_use_inline_bvec(req)) {
   557			bio = &req->z.inline_bio;
   558			bio_init(bio, req->ns->bdev, req->inline_bvec,
   559				 ARRAY_SIZE(req->inline_bvec), op);
   560		} else {
   561			bio = bio_alloc(req->ns->bdev, req->sg_cnt, op, GFP_KERNEL);
   562		}
   563	
   564		bio->bi_end_io = nvmet_bdev_zone_append_bio_done;
   565		bio->bi_iter.bi_sector = sect;
   566		bio->bi_private = req;
   567		if (req->cmd->rw.control & cpu_to_le16(NVME_RW_FUA))
   568			bio->bi_opf |= REQ_FUA;
   569	
   570		for_each_sg(req->sg, sg, req->sg_cnt, sg_cnt) {
   571			struct page *p = sg_page(sg);
   572			unsigned int l = sg->length;
   573			unsigned int o = sg->offset;
   574			unsigned int ret;
   575	
   576			ret = bio_add_zone_append_page(bio, p, l, o);
   577			if (ret != sg->length) {
   578				status = NVME_SC_INTERNAL;
   579				goto out_put_bio;
   580			}
   581			total_len += sg->length;
   582		}
   583	
   584		if (total_len != nvmet_rw_data_len(req)) {
   585			status = NVME_SC_INTERNAL | NVME_SC_DNR;
   586			goto out_put_bio;
   587		}
   588	
   589		submit_bio(bio);
   590		return;
   591	
   592	out_put_bio:
   593		nvmet_req_bio_put(req, bio);
   594	out:
   595		nvmet_req_complete(req, status);
   596	}
   597	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ