mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Anand Jain <anand.jain@oracle.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	David Sterba <dsterba@suse.com>
Subject: fs/btrfs/volumes.c:1004:34: sparse: sparse: incorrect type in assignment (different address spaces)
Date: Sun, 7 Jan 2024 06:59:52 +0800	[thread overview]
Message-ID: <202401070634.inITDmDk-lkp@intel.com> (raw)

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

             reply	other threads:[~2024-01-06 23:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-06 22:59 kernel test robot [this message]
2024-01-09 16:56 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202401070634.inITDmDk-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=anand.jain@oracle.com \
    --cc=dsterba@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®