CC: [email protected] BCC: [email protected] CC: [email protected] TO: Vivek Goyal <[email protected]> CC: Ioannis Angelakopoulos <[email protected]>
tree: https://github.com/rhvgoyal/linux ioannis-fanotify head: 10887e7003a6a801e521d59daff76f0c035f061f commit: ad41fe942800c2d5be17b017c9f75eb44fc692a5 [5/18] virtiofs: Add a virtqueue for notifications :::::: branch date: 8 hours ago :::::: commit date: 8 hours ago config: ia64-randconfig-s032-20220428 (https://download.01.org/0day-ci/archive/20220430/[email protected]/config) compiler: ia64-linux-gcc (GCC) 11.3.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-dirty # https://github.com/rhvgoyal/linux/commit/ad41fe942800c2d5be17b017c9f75eb44fc692a5 git remote add rhvgoyal https://github.com/rhvgoyal/linux git fetch --no-tags rhvgoyal ioannis-fanotify git checkout ad41fe942800c2d5be17b017c9f75eb44fc692a5 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=ia64 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:840:17: sparse: sparse: no generic selection for >> 'unsigned int virtio_cread_v' >> fs/fuse/virtio_fs.c:840:17: sparse: sparse: incompatible types in comparison >> expression (different base types): >> fs/fuse/virtio_fs.c:840:17: sparse: bad type * >> fs/fuse/virtio_fs.c:840:17: sparse: unsigned int * >> fs/fuse/virtio_fs.c:840:17: sparse: sparse: no generic selection for >> 'unsigned int [addressable] virtio_cread_v' vim +840 fs/fuse/virtio_fs.c b43b7e81eb2b188 Vivek Goyal 2020-08-19 822 a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 823 /* Initialize virtqueues */ a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 824 static int virtio_fs_setup_vqs(struct virtio_device *vdev, a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 825 struct virtio_fs *fs) a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 826 { a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 827 struct virtqueue **vqs; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 828 vq_callback_t **callbacks; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 829 const char **names; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 830 unsigned int i; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 831 int ret = 0; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 832 2c0349ec1a8ee6f Michael S. Tsirkin 2020-08-05 833 virtio_cread_le(vdev, struct virtio_fs_config, num_request_queues, a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 834 &fs->num_request_queues); a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 835 if (fs->num_request_queues == 0) a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 836 return -EINVAL; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 837 ad41fe942800c2d Vivek Goyal 2021-09-30 838 if (virtio_has_feature(vdev, VIRTIO_FS_F_NOTIFICATION)) { ad41fe942800c2d Vivek Goyal 2021-09-30 839 fs->notify_enabled = true; ad41fe942800c2d Vivek Goyal 2021-09-30 @840 virtio_cread(vdev, struct virtio_fs_config, notify_buf_size, ad41fe942800c2d Vivek Goyal 2021-09-30 841 &fs->notify_buf_size); ad41fe942800c2d Vivek Goyal 2021-09-30 842 if (fs->notify_buf_size <= sizeof(struct fuse_out_header)) { ad41fe942800c2d Vivek Goyal 2021-09-30 843 pr_err("virtio-fs: Invalid value %d of notification buffer size\n", ad41fe942800c2d Vivek Goyal 2021-09-30 844 fs->notify_buf_size); ad41fe942800c2d Vivek Goyal 2021-09-30 845 return -EINVAL; ad41fe942800c2d Vivek Goyal 2021-09-30 846 } ad41fe942800c2d Vivek Goyal 2021-09-30 847 pr_info("virtio-fs: device supports notification. Notification_buf_size=%u\n", ad41fe942800c2d Vivek Goyal 2021-09-30 848 fs->notify_buf_size); ad41fe942800c2d Vivek Goyal 2021-09-30 849 } ad41fe942800c2d Vivek Goyal 2021-09-30 850 ad41fe942800c2d Vivek Goyal 2021-09-30 851 if (fs->notify_enabled) { ad41fe942800c2d Vivek Goyal 2021-09-30 852 /* One additional queue for hiprio and one for notifications */ ad41fe942800c2d Vivek Goyal 2021-09-30 853 fs->nvqs = 2 + fs->num_request_queues; ad41fe942800c2d Vivek Goyal 2021-09-30 854 fs->first_reqq_idx = VQ_NOTIFY_IDX + 1; ad41fe942800c2d Vivek Goyal 2021-09-30 855 } else { 0c9ba9415107060 Vivek Goyal 2021-09-30 856 fs->nvqs = 1 + fs->num_request_queues; 0c9ba9415107060 Vivek Goyal 2021-09-30 857 fs->first_reqq_idx = 1; ad41fe942800c2d Vivek Goyal 2021-09-30 858 } ad41fe942800c2d Vivek Goyal 2021-09-30 859 2ec2b95ff5a4791 Vivek Goyal 2021-09-30 860 fs->vqs = kcalloc(fs->nvqs, sizeof(fs->vqs[VQ_HIPRIO_IDX]), GFP_KERNEL); a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 861 if (!fs->vqs) a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 862 return -ENOMEM; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 863 2ec2b95ff5a4791 Vivek Goyal 2021-09-30 864 vqs = kmalloc_array(fs->nvqs, sizeof(vqs[VQ_HIPRIO_IDX]), GFP_KERNEL); 2ec2b95ff5a4791 Vivek Goyal 2021-09-30 865 callbacks = kmalloc_array(fs->nvqs, sizeof(callbacks[VQ_HIPRIO_IDX]), 2ec2b95ff5a4791 Vivek Goyal 2021-09-30 866 GFP_KERNEL); 2ec2b95ff5a4791 Vivek Goyal 2021-09-30 867 names = kmalloc_array(fs->nvqs, sizeof(names[VQ_HIPRIO_IDX]), a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 868 GFP_KERNEL); a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 869 if (!vqs || !callbacks || !names) { a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 870 ret = -ENOMEM; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 871 goto out; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 872 } a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 873 b43b7e81eb2b188 Vivek Goyal 2020-08-19 874 /* Initialize the hiprio/forget request virtqueue */ 2ec2b95ff5a4791 Vivek Goyal 2021-09-30 875 callbacks[VQ_HIPRIO_IDX] = virtio_fs_vq_done; ad41fe942800c2d Vivek Goyal 2021-09-30 876 ret = virtio_fs_init_vq(fs, &fs->vqs[VQ_HIPRIO_IDX], "hiprio", ad41fe942800c2d Vivek Goyal 2021-09-30 877 VQ_TYPE_HIPRIO); ad41fe942800c2d Vivek Goyal 2021-09-30 878 if (ret < 0) ad41fe942800c2d Vivek Goyal 2021-09-30 879 goto out; 2ec2b95ff5a4791 Vivek Goyal 2021-09-30 880 names[VQ_HIPRIO_IDX] = fs->vqs[VQ_HIPRIO_IDX].name; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 881 ad41fe942800c2d Vivek Goyal 2021-09-30 882 /* Initialize notification queue */ ad41fe942800c2d Vivek Goyal 2021-09-30 883 if (fs->notify_enabled) { ad41fe942800c2d Vivek Goyal 2021-09-30 884 callbacks[VQ_NOTIFY_IDX] = virtio_fs_vq_done; ad41fe942800c2d Vivek Goyal 2021-09-30 885 ret = virtio_fs_init_vq(fs, &fs->vqs[VQ_NOTIFY_IDX], ad41fe942800c2d Vivek Goyal 2021-09-30 886 "notification", VQ_TYPE_NOTIFY); ad41fe942800c2d Vivek Goyal 2021-09-30 887 if (ret < 0) ad41fe942800c2d Vivek Goyal 2021-09-30 888 goto out; ad41fe942800c2d Vivek Goyal 2021-09-30 889 names[VQ_NOTIFY_IDX] = fs->vqs[VQ_NOTIFY_IDX].name; ad41fe942800c2d Vivek Goyal 2021-09-30 890 } ad41fe942800c2d Vivek Goyal 2021-09-30 891 a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 892 /* Initialize the requests virtqueues */ 0c9ba9415107060 Vivek Goyal 2021-09-30 893 for (i = fs->first_reqq_idx; i < fs->nvqs; i++) { b43b7e81eb2b188 Vivek Goyal 2020-08-19 894 char vq_name[VQ_NAME_LEN]; b43b7e81eb2b188 Vivek Goyal 2020-08-19 895 0c9ba9415107060 Vivek Goyal 2021-09-30 896 snprintf(vq_name, VQ_NAME_LEN, "requests.%u", 0c9ba9415107060 Vivek Goyal 2021-09-30 897 i - fs->first_reqq_idx); ad41fe942800c2d Vivek Goyal 2021-09-30 898 ret = virtio_fs_init_vq(fs, &fs->vqs[i], vq_name, ad41fe942800c2d Vivek Goyal 2021-09-30 899 VQ_TYPE_REQUEST); ad41fe942800c2d Vivek Goyal 2021-09-30 900 if (ret < 0) ad41fe942800c2d Vivek Goyal 2021-09-30 901 goto out; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 902 callbacks[i] = virtio_fs_vq_done; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 903 names[i] = fs->vqs[i].name; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 904 } a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 905 a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 906 ret = virtio_find_vqs(vdev, fs->nvqs, vqs, callbacks, names, NULL); a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 907 if (ret < 0) a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 908 goto out; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 909 a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 910 for (i = 0; i < fs->nvqs; i++) a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 911 fs->vqs[i].vq = vqs[i]; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 912 out: a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 913 kfree(names); a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 914 kfree(callbacks); a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 915 kfree(vqs); ad41fe942800c2d Vivek Goyal 2021-09-30 916 if (ret) { ad41fe942800c2d Vivek Goyal 2021-09-30 917 virtio_fs_free_notify_nodes(fs); a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 918 kfree(fs->vqs); ad41fe942800c2d Vivek Goyal 2021-09-30 919 } a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 920 return ret; a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 921 } a62a8ef9d97da23 Stefan Hajnoczi 2018-06-12 922 -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
