Re: [PATCH] btrfs: allow more subvol= option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Goffredo,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on kdave/for-next]
[also build test WARNING on v5.8-rc6 next-20200721]
[cannot apply to btrfs/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Goffredo-Baroncelli/btrfs-allow-more-subvol-option/20200722-043357
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: x86_64-randconfig-s022-20200719 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-49-g707c5017-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast from restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected unsigned long flags @@     got restricted gfp_t [usertype] mask @@
   include/trace/events/btrfs.h:1335:1: sparse:     expected unsigned long flags
   include/trace/events/btrfs.h:1335:1: sparse:     got restricted gfp_t [usertype] mask
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast to restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: cast to restricted gfp_t
   include/trace/events/btrfs.h:1335:1: sparse: sparse: restricted gfp_t degrades to integer
   include/trace/events/btrfs.h:1335:1: sparse: sparse: restricted gfp_t degrades to integer
>> fs/btrfs/super.c:1714:51: sparse: sparse: Using plain integer as NULL pointer
   fs/btrfs/super.c:2394:31: sparse: sparse: incompatible types in comparison expression (different address spaces):
   fs/btrfs/super.c:2394:31: sparse:    struct rcu_string [noderef] __rcu *
   fs/btrfs/super.c:2394:31: sparse:    struct rcu_string *

vim +1714 fs/btrfs/super.c

  1685	
  1686	/*
  1687	 * Mount function which is called by VFS layer.
  1688	 *
  1689	 * In order to allow mounting a subvolume directly, btrfs uses mount_subtree()
  1690	 * which needs vfsmount* of device's root (/).  This means device's root has to
  1691	 * be mounted internally in any case.
  1692	 *
  1693	 * Operation flow:
  1694	 *   1. Parse subvol id related options for later use in mount_subvol().
  1695	 *
  1696	 *   2. Mount device's root (/) by calling vfs_kern_mount().
  1697	 *
  1698	 *      NOTE: vfs_kern_mount() is used by VFS to call btrfs_mount() in the
  1699	 *      first place. In order to avoid calling btrfs_mount() again, we use
  1700	 *      different file_system_type which is not registered to VFS by
  1701	 *      register_filesystem() (btrfs_root_fs_type). As a result,
  1702	 *      btrfs_mount_root() is called. The return value will be used by
  1703	 *      mount_subtree() in mount_subvol().
  1704	 *
  1705	 *   3. Call mount_subvol() to get the dentry of subvolume. Since there is
  1706	 *      "btrfs subvolume set-default", mount_subvol() is called always.
  1707	 */
  1708	static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
  1709			const char *device_name, void *data)
  1710	{
  1711		struct vfsmount *mnt_root;
  1712		struct dentry *root;
  1713		int i;
> 1714		char *subvol_names[SUBVOL_NAMES_COUNT] = {0,};
  1715		u64 subvol_objectid = 0;
  1716		int error = 0;
  1717	
  1718		error = btrfs_parse_subvol_options(data, subvol_names,
  1719					&subvol_objectid);
  1720		if (error) {
  1721			root = ERR_PTR(error);
  1722			goto out;
  1723		}
  1724	
  1725		/* mount device's root (/) */
  1726		mnt_root = vfs_kern_mount(&btrfs_root_fs_type, flags, device_name, data);
  1727		if (PTR_ERR_OR_ZERO(mnt_root) == -EBUSY) {
  1728			if (flags & SB_RDONLY) {
  1729				mnt_root = vfs_kern_mount(&btrfs_root_fs_type,
  1730					flags & ~SB_RDONLY, device_name, data);
  1731			} else {
  1732				mnt_root = vfs_kern_mount(&btrfs_root_fs_type,
  1733					flags | SB_RDONLY, device_name, data);
  1734				if (IS_ERR(mnt_root)) {
  1735					root = ERR_CAST(mnt_root);
  1736					goto out;
  1737				}
  1738	
  1739				down_write(&mnt_root->mnt_sb->s_umount);
  1740				error = btrfs_remount(mnt_root->mnt_sb, &flags, NULL);
  1741				up_write(&mnt_root->mnt_sb->s_umount);
  1742				if (error < 0) {
  1743					root = ERR_PTR(error);
  1744					mntput(mnt_root);
  1745					goto out;
  1746				}
  1747			}
  1748		}
  1749		if (IS_ERR(mnt_root)) {
  1750			root = ERR_CAST(mnt_root);
  1751			goto out;
  1752		}
  1753	
  1754		/* mount_subvol() will free mnt_root */
  1755		root = mount_subvol(subvol_names, subvol_objectid, mnt_root);
  1756	
  1757	out:
  1758		for (i = 0 ; i < SUBVOL_NAMES_COUNT ; i++)
  1759			kfree(subvol_names[i]);
  1760		return root;
  1761	}
  1762	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux