* fs/btrfs/volumes.c:1004:34: sparse: sparse: incorrect type in assignment (different address spaces)
@ 2024-01-06 22:59 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-01-06 22:59 UTC (permalink / raw)
To: Anand Jain; +Cc: oe-kbuild-all, linux-kernel, David Sterba
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 52b1853b080a082ec3749c3a9577f6c71b1d4a90
commit: bb21e30260a672172a26ee1626dc1463215cf18c btrfs: move device->name RCU allocation and assign to btrfs_alloc_device()
date: 1 year, 1 month ago
config: arm-randconfig-r122-20240105 (https://download.01.org/0day-ci/archive/20240107/202401070634.inITDmDk-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240107/202401070634.inITDmDk-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401070634.inITDmDk-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
fs/btrfs/volumes.c:409:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct rcu_string *str @@ got struct rcu_string [noderef] __rcu *name @@
fs/btrfs/volumes.c:409:31: sparse: expected struct rcu_string *str
fs/btrfs/volumes.c:409:31: sparse: got struct rcu_string [noderef] __rcu *name
fs/btrfs/volumes.c:617:43: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *device_path @@ got char [noderef] __rcu * @@
fs/btrfs/volumes.c:617:43: sparse: expected char const *device_path
fs/btrfs/volumes.c:617:43: sparse: got char [noderef] __rcu *
fs/btrfs/volumes.c:884:50: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const * @@ got char [noderef] __rcu * @@
fs/btrfs/volumes.c:884:50: sparse: expected char const *
fs/btrfs/volumes.c:884:50: sparse: got char [noderef] __rcu *
fs/btrfs/volumes.c:954:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct rcu_string *str @@ got struct rcu_string [noderef] __rcu *name @@
fs/btrfs/volumes.c:954:39: sparse: expected struct rcu_string *str
fs/btrfs/volumes.c:954:39: sparse: got struct rcu_string [noderef] __rcu *name
>> fs/btrfs/volumes.c:1004:34: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected char const *dev_path @@ got char [noderef] __rcu * @@
fs/btrfs/volumes.c:1004:34: sparse: expected char const *dev_path
fs/btrfs/volumes.c:1004:34: sparse: got char [noderef] __rcu *
fs/btrfs/volumes.c:2198:49: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected char const *device_path @@ got char [noderef] __rcu * @@
fs/btrfs/volumes.c:2198:49: sparse: expected char const *device_path
fs/btrfs/volumes.c:2198:49: sparse: got char [noderef] __rcu *
fs/btrfs/volumes.c:2313:41: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected char const *device_path @@ got char [noderef] __rcu * @@
fs/btrfs/volumes.c:2313:41: sparse: expected char const *device_path
fs/btrfs/volumes.c:2313:41: sparse: got char [noderef] __rcu *
fs/btrfs/volumes.c:1446:29: sparse: sparse: self-comparison always evaluates to false
vim +1004 fs/btrfs/volumes.c
980
981 static struct btrfs_fs_devices *clone_fs_devices(struct btrfs_fs_devices *orig)
982 {
983 struct btrfs_fs_devices *fs_devices;
984 struct btrfs_device *device;
985 struct btrfs_device *orig_dev;
986 int ret = 0;
987
988 lockdep_assert_held(&uuid_mutex);
989
990 fs_devices = alloc_fs_devices(orig->fsid, NULL);
991 if (IS_ERR(fs_devices))
992 return fs_devices;
993
994 fs_devices->total_devices = orig->total_devices;
995
996 list_for_each_entry(orig_dev, &orig->devices, dev_list) {
997 const char *dev_path = NULL;
998
999 /*
1000 * This is ok to do without RCU read locked because we hold the
1001 * uuid mutex so nothing we touch in here is going to disappear.
1002 */
1003 if (orig_dev->name)
> 1004 dev_path = orig_dev->name->str;
1005
1006 device = btrfs_alloc_device(NULL, &orig_dev->devid,
1007 orig_dev->uuid, dev_path);
1008 if (IS_ERR(device)) {
1009 ret = PTR_ERR(device);
1010 goto error;
1011 }
1012
1013 if (orig_dev->zone_info) {
1014 struct btrfs_zoned_device_info *zone_info;
1015
1016 zone_info = btrfs_clone_dev_zone_info(orig_dev);
1017 if (!zone_info) {
1018 btrfs_free_device(device);
1019 ret = -ENOMEM;
1020 goto error;
1021 }
1022 device->zone_info = zone_info;
1023 }
1024
1025 list_add(&device->dev_list, &fs_devices->devices);
1026 device->fs_devices = fs_devices;
1027 fs_devices->num_devices++;
1028 }
1029 return fs_devices;
1030 error:
1031 free_fs_devices(fs_devices);
1032 return ERR_PTR(ret);
1033 }
1034
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* fs/btrfs/volumes.c:1004:34: sparse: sparse: incorrect type in assignment (different address spaces)
@ 2024-01-09 16:56 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-01-09 16:56 UTC (permalink / raw)
To: Anand Jain; +Cc: oe-kbuild-all, linux-kernel, David Sterba
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9f8413c4a66f2fb776d3dc3c9ed20bf435eb305e
commit: bb21e30260a672172a26ee1626dc1463215cf18c btrfs: move device->name RCU allocation and assign to btrfs_alloc_device()
date: 1 year, 1 month ago
config: arm-randconfig-r122-20240105 (https://download.01.org/0day-ci/archive/20240110/202401100008.8yNVvYRI-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240110/202401100008.8yNVvYRI-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401100008.8yNVvYRI-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
fs/btrfs/volumes.c:409:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct rcu_string *str @@ got struct rcu_string [noderef] __rcu *name @@
fs/btrfs/volumes.c:409:31: sparse: expected struct rcu_string *str
fs/btrfs/volumes.c:409:31: sparse: got struct rcu_string [noderef] __rcu *name
fs/btrfs/volumes.c:617:43: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *device_path @@ got char [noderef] __rcu * @@
fs/btrfs/volumes.c:617:43: sparse: expected char const *device_path
fs/btrfs/volumes.c:617:43: sparse: got char [noderef] __rcu *
fs/btrfs/volumes.c:884:50: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const * @@ got char [noderef] __rcu * @@
fs/btrfs/volumes.c:884:50: sparse: expected char const *
fs/btrfs/volumes.c:884:50: sparse: got char [noderef] __rcu *
fs/btrfs/volumes.c:954:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct rcu_string *str @@ got struct rcu_string [noderef] __rcu *name @@
fs/btrfs/volumes.c:954:39: sparse: expected struct rcu_string *str
fs/btrfs/volumes.c:954:39: sparse: got struct rcu_string [noderef] __rcu *name
>> fs/btrfs/volumes.c:1004:34: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected char const *dev_path @@ got char [noderef] __rcu * @@
fs/btrfs/volumes.c:1004:34: sparse: expected char const *dev_path
fs/btrfs/volumes.c:1004:34: sparse: got char [noderef] __rcu *
fs/btrfs/volumes.c:2198:49: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected char const *device_path @@ got char [noderef] __rcu * @@
fs/btrfs/volumes.c:2198:49: sparse: expected char const *device_path
fs/btrfs/volumes.c:2198:49: sparse: got char [noderef] __rcu *
fs/btrfs/volumes.c:2313:41: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected char const *device_path @@ got char [noderef] __rcu * @@
fs/btrfs/volumes.c:2313:41: sparse: expected char const *device_path
fs/btrfs/volumes.c:2313:41: sparse: got char [noderef] __rcu *
fs/btrfs/volumes.c:1446:29: sparse: sparse: self-comparison always evaluates to false
vim +1004 fs/btrfs/volumes.c
980
981 static struct btrfs_fs_devices *clone_fs_devices(struct btrfs_fs_devices *orig)
982 {
983 struct btrfs_fs_devices *fs_devices;
984 struct btrfs_device *device;
985 struct btrfs_device *orig_dev;
986 int ret = 0;
987
988 lockdep_assert_held(&uuid_mutex);
989
990 fs_devices = alloc_fs_devices(orig->fsid, NULL);
991 if (IS_ERR(fs_devices))
992 return fs_devices;
993
994 fs_devices->total_devices = orig->total_devices;
995
996 list_for_each_entry(orig_dev, &orig->devices, dev_list) {
997 const char *dev_path = NULL;
998
999 /*
1000 * This is ok to do without RCU read locked because we hold the
1001 * uuid mutex so nothing we touch in here is going to disappear.
1002 */
1003 if (orig_dev->name)
> 1004 dev_path = orig_dev->name->str;
1005
1006 device = btrfs_alloc_device(NULL, &orig_dev->devid,
1007 orig_dev->uuid, dev_path);
1008 if (IS_ERR(device)) {
1009 ret = PTR_ERR(device);
1010 goto error;
1011 }
1012
1013 if (orig_dev->zone_info) {
1014 struct btrfs_zoned_device_info *zone_info;
1015
1016 zone_info = btrfs_clone_dev_zone_info(orig_dev);
1017 if (!zone_info) {
1018 btrfs_free_device(device);
1019 ret = -ENOMEM;
1020 goto error;
1021 }
1022 device->zone_info = zone_info;
1023 }
1024
1025 list_add(&device->dev_list, &fs_devices->devices);
1026 device->fs_devices = fs_devices;
1027 fs_devices->num_devices++;
1028 }
1029 return fs_devices;
1030 error:
1031 free_fs_devices(fs_devices);
1032 return ERR_PTR(ret);
1033 }
1034
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-09 16:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-06 22:59 fs/btrfs/volumes.c:1004:34: sparse: sparse: incorrect type in assignment (different address spaces) kernel test robot
2024-01-09 16:56 kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®