CC: [email protected]
CC: [email protected]
TO: Vivek Goyal <[email protected]>
CC: Miklos Szeredi <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
CC: "Dr. David Alan Gilbert" <[email protected]>
CC: Liu Bo <[email protected]>
CC: Peng Tao <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   3d5895cd351757f69c9a66fb5fc8cf19f454d773
commit: c2d0ad00d948de73c78f05d2b3e5bdfa605035cc virtiofs: implement dax 
read/write operations
date:   11 months ago
:::::: branch date: 9 hours ago
:::::: commit date: 11 months ago
config: i386-randconfig-m021-20210722 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.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]>

smatch warnings:
fs/fuse/dax.c:113 fuse_setup_one_mapping() warn: should 'start_idx << 21' be a 
64 bit type?
fs/fuse/dax.c:197 dmap_removemapping_list() error: uninitialized symbol 'ret'.
fs/fuse/dax.c:514 fuse_dax_read_iter() warn: inconsistent returns 
'&inode->i_rwsem'.
fs/fuse/dax.c:575 fuse_dax_write_iter() warn: inconsistent returns 
'&inode->i_rwsem'.

vim +113 fs/fuse/dax.c

c2d0ad00d948de Vivek Goyal 2020-08-19  104  
c2d0ad00d948de Vivek Goyal 2020-08-19  105  static int 
fuse_setup_one_mapping(struct inode *inode, unsigned long start_idx,
c2d0ad00d948de Vivek Goyal 2020-08-19  106                                
struct fuse_dax_mapping *dmap, bool writable,
c2d0ad00d948de Vivek Goyal 2020-08-19  107                                bool 
upgrade)
c2d0ad00d948de Vivek Goyal 2020-08-19  108  {
c2d0ad00d948de Vivek Goyal 2020-08-19  109      struct fuse_conn *fc = 
get_fuse_conn(inode);
c2d0ad00d948de Vivek Goyal 2020-08-19  110      struct fuse_conn_dax *fcd = 
fc->dax;
c2d0ad00d948de Vivek Goyal 2020-08-19  111      struct fuse_inode *fi = 
get_fuse_inode(inode);
c2d0ad00d948de Vivek Goyal 2020-08-19  112      struct fuse_setupmapping_in 
inarg;
c2d0ad00d948de Vivek Goyal 2020-08-19 @113      loff_t offset = start_idx << 
FUSE_DAX_SHIFT;
c2d0ad00d948de Vivek Goyal 2020-08-19  114      FUSE_ARGS(args);
c2d0ad00d948de Vivek Goyal 2020-08-19  115      ssize_t err;
c2d0ad00d948de Vivek Goyal 2020-08-19  116  
c2d0ad00d948de Vivek Goyal 2020-08-19  117      WARN_ON(fcd->nr_free_ranges < 
0);
c2d0ad00d948de Vivek Goyal 2020-08-19  118  
c2d0ad00d948de Vivek Goyal 2020-08-19  119      /* Ask fuse daemon to setup 
mapping */
c2d0ad00d948de Vivek Goyal 2020-08-19  120      memset(&inarg, 0, 
sizeof(inarg));
c2d0ad00d948de Vivek Goyal 2020-08-19  121      inarg.foffset = offset;
c2d0ad00d948de Vivek Goyal 2020-08-19  122      inarg.fh = -1;
c2d0ad00d948de Vivek Goyal 2020-08-19  123      inarg.moffset = 
dmap->window_offset;
c2d0ad00d948de Vivek Goyal 2020-08-19  124      inarg.len = FUSE_DAX_SZ;
c2d0ad00d948de Vivek Goyal 2020-08-19  125      inarg.flags |= 
FUSE_SETUPMAPPING_FLAG_READ;
c2d0ad00d948de Vivek Goyal 2020-08-19  126      if (writable)
c2d0ad00d948de Vivek Goyal 2020-08-19  127              inarg.flags |= 
FUSE_SETUPMAPPING_FLAG_WRITE;
c2d0ad00d948de Vivek Goyal 2020-08-19  128      args.opcode = FUSE_SETUPMAPPING;
c2d0ad00d948de Vivek Goyal 2020-08-19  129      args.nodeid = fi->nodeid;
c2d0ad00d948de Vivek Goyal 2020-08-19  130      args.in_numargs = 1;
c2d0ad00d948de Vivek Goyal 2020-08-19  131      args.in_args[0].size = 
sizeof(inarg);
c2d0ad00d948de Vivek Goyal 2020-08-19  132      args.in_args[0].value = &inarg;
c2d0ad00d948de Vivek Goyal 2020-08-19  133      err = fuse_simple_request(fc, 
&args);
c2d0ad00d948de Vivek Goyal 2020-08-19  134      if (err < 0)
c2d0ad00d948de Vivek Goyal 2020-08-19  135              return err;
c2d0ad00d948de Vivek Goyal 2020-08-19  136      dmap->writable = writable;
c2d0ad00d948de Vivek Goyal 2020-08-19  137      if (!upgrade) {
c2d0ad00d948de Vivek Goyal 2020-08-19  138              dmap->itn.start = 
dmap->itn.last = start_idx;
c2d0ad00d948de Vivek Goyal 2020-08-19  139              /* Protected by 
fi->dax->sem */
c2d0ad00d948de Vivek Goyal 2020-08-19  140              
interval_tree_insert(&dmap->itn, &fi->dax->tree);
c2d0ad00d948de Vivek Goyal 2020-08-19  141              fi->dax->nr++;
c2d0ad00d948de Vivek Goyal 2020-08-19  142      }
c2d0ad00d948de Vivek Goyal 2020-08-19  143      return 0;
c2d0ad00d948de Vivek Goyal 2020-08-19  144  }
c2d0ad00d948de Vivek Goyal 2020-08-19  145  
c2d0ad00d948de Vivek Goyal 2020-08-19  146  static int 
fuse_send_removemapping(struct inode *inode,
c2d0ad00d948de Vivek Goyal 2020-08-19  147                                 
struct fuse_removemapping_in *inargp,
c2d0ad00d948de Vivek Goyal 2020-08-19  148                                 
struct fuse_removemapping_one *remove_one)
c2d0ad00d948de Vivek Goyal 2020-08-19  149  {
c2d0ad00d948de Vivek Goyal 2020-08-19  150      struct fuse_inode *fi = 
get_fuse_inode(inode);
c2d0ad00d948de Vivek Goyal 2020-08-19  151      struct fuse_conn *fc = 
get_fuse_conn(inode);
c2d0ad00d948de Vivek Goyal 2020-08-19  152      FUSE_ARGS(args);
c2d0ad00d948de Vivek Goyal 2020-08-19  153  
c2d0ad00d948de Vivek Goyal 2020-08-19  154      args.opcode = 
FUSE_REMOVEMAPPING;
c2d0ad00d948de Vivek Goyal 2020-08-19  155      args.nodeid = fi->nodeid;
c2d0ad00d948de Vivek Goyal 2020-08-19  156      args.in_numargs = 2;
c2d0ad00d948de Vivek Goyal 2020-08-19  157      args.in_args[0].size = 
sizeof(*inargp);
c2d0ad00d948de Vivek Goyal 2020-08-19  158      args.in_args[0].value = inargp;
c2d0ad00d948de Vivek Goyal 2020-08-19  159      args.in_args[1].size = 
inargp->count * sizeof(*remove_one);
c2d0ad00d948de Vivek Goyal 2020-08-19  160      args.in_args[1].value = 
remove_one;
c2d0ad00d948de Vivek Goyal 2020-08-19  161      return fuse_simple_request(fc, 
&args);
c2d0ad00d948de Vivek Goyal 2020-08-19  162  }
c2d0ad00d948de Vivek Goyal 2020-08-19  163  
c2d0ad00d948de Vivek Goyal 2020-08-19  164  static int 
dmap_removemapping_list(struct inode *inode, unsigned int num,
c2d0ad00d948de Vivek Goyal 2020-08-19  165                                 
struct list_head *to_remove)
c2d0ad00d948de Vivek Goyal 2020-08-19  166  {
c2d0ad00d948de Vivek Goyal 2020-08-19  167      struct fuse_removemapping_one 
*remove_one, *ptr;
c2d0ad00d948de Vivek Goyal 2020-08-19  168      struct fuse_removemapping_in 
inarg;
c2d0ad00d948de Vivek Goyal 2020-08-19  169      struct fuse_dax_mapping *dmap;
c2d0ad00d948de Vivek Goyal 2020-08-19  170      int ret, i = 0, nr_alloc;
c2d0ad00d948de Vivek Goyal 2020-08-19  171  
c2d0ad00d948de Vivek Goyal 2020-08-19  172      nr_alloc = min_t(unsigned int, 
num, FUSE_REMOVEMAPPING_MAX_ENTRY);
c2d0ad00d948de Vivek Goyal 2020-08-19  173      remove_one = 
kmalloc_array(nr_alloc, sizeof(*remove_one), GFP_NOFS);
c2d0ad00d948de Vivek Goyal 2020-08-19  174      if (!remove_one)
c2d0ad00d948de Vivek Goyal 2020-08-19  175              return -ENOMEM;
c2d0ad00d948de Vivek Goyal 2020-08-19  176  
c2d0ad00d948de Vivek Goyal 2020-08-19  177      ptr = remove_one;
c2d0ad00d948de Vivek Goyal 2020-08-19  178      list_for_each_entry(dmap, 
to_remove, list) {
c2d0ad00d948de Vivek Goyal 2020-08-19  179              ptr->moffset = 
dmap->window_offset;
c2d0ad00d948de Vivek Goyal 2020-08-19  180              ptr->len = dmap->length;
c2d0ad00d948de Vivek Goyal 2020-08-19  181              ptr++;
c2d0ad00d948de Vivek Goyal 2020-08-19  182              i++;
c2d0ad00d948de Vivek Goyal 2020-08-19  183              num--;
c2d0ad00d948de Vivek Goyal 2020-08-19  184              if (i >= nr_alloc || 
num == 0) {
c2d0ad00d948de Vivek Goyal 2020-08-19  185                      memset(&inarg, 
0, sizeof(inarg));
c2d0ad00d948de Vivek Goyal 2020-08-19  186                      inarg.count = i;
c2d0ad00d948de Vivek Goyal 2020-08-19  187                      ret = 
fuse_send_removemapping(inode, &inarg,
c2d0ad00d948de Vivek Goyal 2020-08-19  188                                      
              remove_one);
c2d0ad00d948de Vivek Goyal 2020-08-19  189                      if (ret)
c2d0ad00d948de Vivek Goyal 2020-08-19  190                              goto 
out;
c2d0ad00d948de Vivek Goyal 2020-08-19  191                      ptr = 
remove_one;
c2d0ad00d948de Vivek Goyal 2020-08-19  192                      i = 0;
c2d0ad00d948de Vivek Goyal 2020-08-19  193              }
c2d0ad00d948de Vivek Goyal 2020-08-19  194      }
c2d0ad00d948de Vivek Goyal 2020-08-19  195  out:
c2d0ad00d948de Vivek Goyal 2020-08-19  196      kfree(remove_one);
c2d0ad00d948de Vivek Goyal 2020-08-19 @197      return ret;
c2d0ad00d948de Vivek Goyal 2020-08-19  198  }
c2d0ad00d948de Vivek Goyal 2020-08-19  199  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to