CC: [email protected]
CC: [email protected]
TO: Vivek Goyal <[email protected]>
CC: Ioannis Angelakopoulos <[email protected]>

tree:   https://github.com/rhvgoyal/linux notification-queue
head:   8a74e3a5793e164bac09552c801823eabdb841b1
commit: 78212035be092b3d3f56e3601b2350e86493dff8 [5/8] virtiofs: Add a 
virtqueue for notifications
:::::: branch date: 9 hours ago
:::::: commit date: 9 hours ago
config: i386-randconfig-s001-20210930 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # 
https://github.com/rhvgoyal/linux/commit/78212035be092b3d3f56e3601b2350e86493dff8
        git remote add rhvgoyal https://github.com/rhvgoyal/linux
        git fetch --no-tags rhvgoyal notification-queue
        git checkout 78212035be092b3d3f56e3601b2350e86493dff8
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir 
ARCH=i386 SHELL=/bin/bash fs/fuse/

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


sparse warnings: (new ones prefixed by >>)
>> fs/fuse/virtio_fs.c:827:17: sparse: sparse: no generic selection for 
>> 'unsigned int virtio_cread_v'
>> fs/fuse/virtio_fs.c:827:17: sparse: sparse: incompatible types in comparison 
>> expression (different base types):
>> fs/fuse/virtio_fs.c:827:17: sparse:    bad type *
>> fs/fuse/virtio_fs.c:827:17: sparse:    unsigned int *
>> fs/fuse/virtio_fs.c:827:17: sparse: sparse: no generic selection for 
>> 'unsigned int [addressable] virtio_cread_v'

vim +827 fs/fuse/virtio_fs.c

b43b7e81eb2b18 Vivek Goyal        2020-08-19  809  
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  810  /* Initialize virtqueues */
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  811  static int 
virtio_fs_setup_vqs(struct virtio_device *vdev,
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  812                              
struct virtio_fs *fs)
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  813  {
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  814       struct virtqueue **vqs;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  815       vq_callback_t 
**callbacks;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  816       const char **names;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  817       unsigned int i;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  818       int ret = 0;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  819  
2c0349ec1a8ee6 Michael S. Tsirkin 2020-08-05  820       virtio_cread_le(vdev, 
struct virtio_fs_config, num_request_queues,
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  821                       
&fs->num_request_queues);
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  822       if 
(fs->num_request_queues == 0)
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  823               return -EINVAL;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  824  
78212035be092b Vivek Goyal        2021-09-30  825       if 
(virtio_has_feature(vdev, VIRTIO_FS_F_NOTIFICATION)) {
78212035be092b Vivek Goyal        2021-09-30  826               
fs->notify_enabled = true;
78212035be092b Vivek Goyal        2021-09-30 @827               
virtio_cread(vdev, struct virtio_fs_config, notify_buf_size,
78212035be092b Vivek Goyal        2021-09-30  828                            
&fs->notify_buf_size);
78212035be092b Vivek Goyal        2021-09-30  829               if 
(fs->notify_buf_size <= sizeof(struct fuse_out_header)) {
78212035be092b Vivek Goyal        2021-09-30  830                       
pr_err("virtio-fs: Invalid value %d of notification buffer size\n",
78212035be092b Vivek Goyal        2021-09-30  831                              
fs->notify_buf_size);
78212035be092b Vivek Goyal        2021-09-30  832                       return 
-EINVAL;
78212035be092b Vivek Goyal        2021-09-30  833               }
78212035be092b Vivek Goyal        2021-09-30  834               
pr_info("virtio-fs: device supports notification. Notification_buf_size=%u\n",
78212035be092b Vivek Goyal        2021-09-30  835                       
fs->notify_buf_size);
78212035be092b Vivek Goyal        2021-09-30  836       }
78212035be092b Vivek Goyal        2021-09-30  837  
78212035be092b Vivek Goyal        2021-09-30  838       if (fs->notify_enabled) 
{
78212035be092b Vivek Goyal        2021-09-30  839               /* One 
additional queue for hiprio and one for notifications */
78212035be092b Vivek Goyal        2021-09-30  840               fs->nvqs = 2 + 
fs->num_request_queues;
78212035be092b Vivek Goyal        2021-09-30  841               
fs->first_reqq_idx = VQ_NOTIFY_IDX + 1;
78212035be092b Vivek Goyal        2021-09-30  842       } else {
db6f0eafcba856 Vivek Goyal        2021-09-30  843               fs->nvqs = 1 + 
fs->num_request_queues;
db6f0eafcba856 Vivek Goyal        2021-09-30  844               
fs->first_reqq_idx = 1;
78212035be092b Vivek Goyal        2021-09-30  845       }
78212035be092b Vivek Goyal        2021-09-30  846  
cde214bdd169d9 Vivek Goyal        2021-09-30  847       fs->vqs = 
kcalloc(fs->nvqs, sizeof(fs->vqs[VQ_HIPRIO_IDX]), GFP_KERNEL);
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  848       if (!fs->vqs)
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  849               return -ENOMEM;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  850  
cde214bdd169d9 Vivek Goyal        2021-09-30  851       vqs = 
kmalloc_array(fs->nvqs, sizeof(vqs[VQ_HIPRIO_IDX]), GFP_KERNEL);
cde214bdd169d9 Vivek Goyal        2021-09-30  852       callbacks = 
kmalloc_array(fs->nvqs, sizeof(callbacks[VQ_HIPRIO_IDX]),
cde214bdd169d9 Vivek Goyal        2021-09-30  853                               
        GFP_KERNEL);
cde214bdd169d9 Vivek Goyal        2021-09-30  854       names = 
kmalloc_array(fs->nvqs, sizeof(names[VQ_HIPRIO_IDX]),
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  855                             
GFP_KERNEL);
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  856       if (!vqs || !callbacks 
|| !names) {
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  857               ret = -ENOMEM;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  858               goto out;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  859       }
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  860  
b43b7e81eb2b18 Vivek Goyal        2020-08-19  861       /* Initialize the 
hiprio/forget request virtqueue */
cde214bdd169d9 Vivek Goyal        2021-09-30  862       
callbacks[VQ_HIPRIO_IDX] = virtio_fs_vq_done;
78212035be092b Vivek Goyal        2021-09-30  863       ret = 
virtio_fs_init_vq(fs, &fs->vqs[VQ_HIPRIO_IDX], "hiprio",
78212035be092b Vivek Goyal        2021-09-30  864                               
VQ_TYPE_HIPRIO);
78212035be092b Vivek Goyal        2021-09-30  865       if (ret < 0)
78212035be092b Vivek Goyal        2021-09-30  866               goto out;
cde214bdd169d9 Vivek Goyal        2021-09-30  867       names[VQ_HIPRIO_IDX] = 
fs->vqs[VQ_HIPRIO_IDX].name;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  868  
78212035be092b Vivek Goyal        2021-09-30  869       /* Initialize 
notification queue */
78212035be092b Vivek Goyal        2021-09-30  870       if (fs->notify_enabled) 
{
78212035be092b Vivek Goyal        2021-09-30  871               
callbacks[VQ_NOTIFY_IDX] = virtio_fs_vq_done;
78212035be092b Vivek Goyal        2021-09-30  872               ret = 
virtio_fs_init_vq(fs, &fs->vqs[VQ_NOTIFY_IDX],
78212035be092b Vivek Goyal        2021-09-30  873                               
        "notification", VQ_TYPE_NOTIFY);
78212035be092b Vivek Goyal        2021-09-30  874               if (ret < 0)
78212035be092b Vivek Goyal        2021-09-30  875                       goto 
out;
78212035be092b Vivek Goyal        2021-09-30  876               
names[VQ_NOTIFY_IDX] = fs->vqs[VQ_NOTIFY_IDX].name;
78212035be092b Vivek Goyal        2021-09-30  877       }
78212035be092b Vivek Goyal        2021-09-30  878  
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  879       /* Initialize the 
requests virtqueues */
db6f0eafcba856 Vivek Goyal        2021-09-30  880       for (i = 
fs->first_reqq_idx; i < fs->nvqs; i++) {
b43b7e81eb2b18 Vivek Goyal        2020-08-19  881               char 
vq_name[VQ_NAME_LEN];
b43b7e81eb2b18 Vivek Goyal        2020-08-19  882  
db6f0eafcba856 Vivek Goyal        2021-09-30  883               
snprintf(vq_name, VQ_NAME_LEN, "requests.%u",
db6f0eafcba856 Vivek Goyal        2021-09-30  884                        i - 
fs->first_reqq_idx);
78212035be092b Vivek Goyal        2021-09-30  885               ret = 
virtio_fs_init_vq(fs, &fs->vqs[i], vq_name,
78212035be092b Vivek Goyal        2021-09-30  886                               
        VQ_TYPE_REQUEST);
78212035be092b Vivek Goyal        2021-09-30  887               if (ret < 0)
78212035be092b Vivek Goyal        2021-09-30  888                       goto 
out;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  889               callbacks[i] = 
virtio_fs_vq_done;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  890               names[i] = 
fs->vqs[i].name;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  891       }
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  892  
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  893       ret = 
virtio_find_vqs(vdev, fs->nvqs, vqs, callbacks, names, NULL);
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  894       if (ret < 0)
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  895               goto out;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  896  
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  897       for (i = 0; i < 
fs->nvqs; i++)
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  898               fs->vqs[i].vq = 
vqs[i];
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  899  out:
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  900       kfree(names);
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  901       kfree(callbacks);
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  902       kfree(vqs);
78212035be092b Vivek Goyal        2021-09-30  903       if (ret) {
78212035be092b Vivek Goyal        2021-09-30  904               
virtio_fs_free_notify_nodes(fs);
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  905               kfree(fs->vqs);
78212035be092b Vivek Goyal        2021-09-30  906       }
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  907       return ret;
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  908  }
a62a8ef9d97da2 Stefan Hajnoczi    2018-06-12  909  

---
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