CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Nitesh Shetty <[email protected]>
TO: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]

Hi Nitesh,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on axboe-block/for-next]
[also build test WARNING on linus/master v5.17-rc3 next-20220210]
[cannot apply to device-mapper-dm/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    
https://github.com/0day-ci/linux/commits/Nitesh-Shetty/block-make-bio_map_kern-non-static/20220207-231407
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git 
for-next
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: i386-randconfig-m021-20220207 
(https://download.01.org/0day-ci/archive/20220211/[email protected]/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

New smatch warnings:
drivers/nvme/target/io-cmd-file.c:377 nvmet_file_copy_work() error: 
uninitialized symbol 'len'.
drivers/nvme/target/io-cmd-bdev.c:479 nvmet_bdev_execute_copy() warn: should 
'(((range.nlb)) + 1) << req->ns->blksize_shift' be a 64 bit type?

Old smatch warnings:
drivers/nvme/target/io-cmd-bdev.c:377 nvmet_bdev_discard_range() warn: should 
'((range->nlb)) << (ns->blksize_shift - 9)' be a 64 bit type?

vim +/len +377 drivers/nvme/target/io-cmd-file.c

d5eff33ee6f8086 Chaitanya Kulkarni 2018-05-23  349  
6bb6ea64499e1ac Arnav Dawn         2022-02-07  350  static void 
nvmet_file_copy_work(struct work_struct *w)
6bb6ea64499e1ac Arnav Dawn         2022-02-07  351  {
6bb6ea64499e1ac Arnav Dawn         2022-02-07  352      struct nvmet_req *req = 
container_of(w, struct nvmet_req, f.work);
6bb6ea64499e1ac Arnav Dawn         2022-02-07  353      int nr_range;
6bb6ea64499e1ac Arnav Dawn         2022-02-07  354      loff_t pos;
6bb6ea64499e1ac Arnav Dawn         2022-02-07  355      struct nvme_command 
*cmnd = req->cmd;
6bb6ea64499e1ac Arnav Dawn         2022-02-07  356      int ret = 0, len, src, 
id;
6bb6ea64499e1ac Arnav Dawn         2022-02-07  357  
6bb6ea64499e1ac Arnav Dawn         2022-02-07  358      nr_range = 
cmnd->copy.nr_range + 1;
6bb6ea64499e1ac Arnav Dawn         2022-02-07  359      pos = 
le64_to_cpu(req->cmd->copy.sdlba) << req->ns->blksize_shift;
6bb6ea64499e1ac Arnav Dawn         2022-02-07  360      if (unlikely(pos + 
req->transfer_len > req->ns->size)) {
6bb6ea64499e1ac Arnav Dawn         2022-02-07  361              
nvmet_req_complete(req, errno_to_nvme_status(req, -ENOSPC));
6bb6ea64499e1ac Arnav Dawn         2022-02-07  362              return;
6bb6ea64499e1ac Arnav Dawn         2022-02-07  363      }
6bb6ea64499e1ac Arnav Dawn         2022-02-07  364  
6bb6ea64499e1ac Arnav Dawn         2022-02-07  365      for (id = 0 ; id < 
nr_range; id++) {
6bb6ea64499e1ac Arnav Dawn         2022-02-07  366              struct 
nvme_copy_range range;
6bb6ea64499e1ac Arnav Dawn         2022-02-07  367  
6bb6ea64499e1ac Arnav Dawn         2022-02-07  368              ret = 
nvmet_copy_from_sgl(req, id * sizeof(range), &range,
6bb6ea64499e1ac Arnav Dawn         2022-02-07  369                              
        sizeof(range));
6bb6ea64499e1ac Arnav Dawn         2022-02-07  370              if (ret)
6bb6ea64499e1ac Arnav Dawn         2022-02-07  371                      goto 
out;
6bb6ea64499e1ac Arnav Dawn         2022-02-07  372  
6bb6ea64499e1ac Arnav Dawn         2022-02-07  373              len = 
(le16_to_cpu(range.nlb) + 1) << (req->ns->blksize_shift);
6bb6ea64499e1ac Arnav Dawn         2022-02-07  374              src = 
(le64_to_cpu(range.slba) << (req->ns->blksize_shift));
6bb6ea64499e1ac Arnav Dawn         2022-02-07  375              ret = 
vfs_copy_file_range(req->ns->file, src, req->ns->file, pos, len, 0);
6bb6ea64499e1ac Arnav Dawn         2022-02-07  376  out:
6bb6ea64499e1ac Arnav Dawn         2022-02-07 @377              if (ret != len) 
{
6bb6ea64499e1ac Arnav Dawn         2022-02-07  378                      pos += 
ret;
6bb6ea64499e1ac Arnav Dawn         2022-02-07  379                      
req->cqe->result.u32 = cpu_to_le32(id);
6bb6ea64499e1ac Arnav Dawn         2022-02-07  380                      
nvmet_req_complete(req, ret < 0 ? errno_to_nvme_status(req, ret) :
6bb6ea64499e1ac Arnav Dawn         2022-02-07  381                              
        errno_to_nvme_status(req, -EIO));
6bb6ea64499e1ac Arnav Dawn         2022-02-07  382                      return;
6bb6ea64499e1ac Arnav Dawn         2022-02-07  383  
6bb6ea64499e1ac Arnav Dawn         2022-02-07  384              } else
6bb6ea64499e1ac Arnav Dawn         2022-02-07  385                      pos += 
len;
6bb6ea64499e1ac Arnav Dawn         2022-02-07  386  }
6bb6ea64499e1ac Arnav Dawn         2022-02-07  387      nvmet_req_complete(req, 
ret);
6bb6ea64499e1ac Arnav Dawn         2022-02-07  388  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to