Re: [PATCH v2 4/6] fs: implement fsconfig via configfd

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

 



Hi James,

I love your patch! Perhaps something to improve:

[auto build test WARNING on s390/features]
[also build test WARNING on linus/master v5.5-rc5]
[cannot apply to arm64/for-next/core tip/x86/asm arm/for-next ia64/next m68k/for-next hp-parisc/for-next powerpc/next sparc-next/master next-20200110]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/James-Bottomley/introduce-configfd-as-generalisation-of-fsconfig/20200105-080415
base:   https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-129-g341daf20-dirty
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

>> fs/fsopen.c:116:31: sparse: sparse: incorrect type in argument 1 (different address spaces)
>> fs/fsopen.c:116:31: sparse:    expected char const *
>> fs/fsopen.c:116:31: sparse:    got char const [noderef] <asn:1> *path

vim +116 fs/fsopen.c

    78	
    79	/*
    80	 * Pick a superblock into a context for reconfiguration.
    81	 */
    82	SYSCALL_DEFINE3(fspick, int, dfd, const char __user *, path, unsigned int, flags)
    83	{
    84		struct path *target;
    85		unsigned int lookup_flags;
    86		int ret;
    87		int fd;
    88		struct configfd_param cp;
    89		struct open_flags of;
    90		struct filename *name;
    91		struct file *file;
    92	
    93		if (!ns_capable(current->nsproxy->mnt_ns->user_ns, CAP_SYS_ADMIN))
    94			return -EPERM;
    95	
    96		if ((flags & ~(FSPICK_CLOEXEC |
    97			       FSPICK_SYMLINK_NOFOLLOW |
    98			       FSPICK_NO_AUTOMOUNT |
    99			       FSPICK_EMPTY_PATH)) != 0)
   100			return -EINVAL;
   101	
   102		lookup_flags = LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT;
   103		if (flags & FSPICK_SYMLINK_NOFOLLOW)
   104			lookup_flags &= ~LOOKUP_FOLLOW;
   105		if (flags & FSPICK_NO_AUTOMOUNT)
   106			lookup_flags &= ~LOOKUP_AUTOMOUNT;
   107		if (flags & FSPICK_EMPTY_PATH)
   108			lookup_flags |= LOOKUP_EMPTY;
   109	
   110		of.lookup_flags = lookup_flags;
   111		of.intent = LOOKUP_OPEN;
   112		of.acc_mode = 0;
   113		of.mode = 0;
   114		of.open_flag = O_PATH;
   115	
 > 116		name = getname_kernel(path);
   117		if (IS_ERR(name))
   118			return PTR_ERR(name);
   119	
   120		file = do_filp_open(dfd, name, &of);
   121		putname(name);
   122		if (IS_ERR(file))
   123			return PTR_ERR(file);
   124	
   125		target = &file->f_path;
   126		ret = -EINVAL;
   127		if (target->mnt->mnt_root != target->dentry)
   128			goto err_file;
   129	
   130		ret = fd = kern_configfd_open("mount",
   131					      flags & FSPICK_CLOEXEC ? O_CLOEXEC : 0,
   132					      CONFIGFD_CMD_RECONFIGURE);
   133		if (ret < 0)
   134			goto err_file;
   135		cp = (struct configfd_param) {
   136			.key = "pathfd",
   137			.file = file,
   138			.cmd = CONFIGFD_SET_FD,
   139		};
   140		ret = kern_configfd_action(fd, &cp);
   141		/* file gets NULL'd if successfully installed otherwise we put */
   142		if (cp.file)
   143			fput(file);
   144		if (ret < 0)
   145			goto err_close;
   146		return fd;
   147	
   148	 err_close:
   149		ksys_close(fd);
   150	 err_file:
   151		fput(file);
   152		return ret;
   153	}
   154	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx Intel Corporation



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux