Content-Type: multipart/mixed; boundary="===============4771163422160101657==" MIME-Version: 1.0 From: kbuild test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH v2 4/6] fs: implement fsconfig via configfd Date: Sun, 12 Jan 2020 03:58:52 +0800 Message-ID: <202001120308.0Y6AXzgU%lkp@intel.com> In-Reply-To: <20200104201432.27320-5-James.Bottomley@HansenPartnership.com> List-Id: --===============4771163422160101657== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 m68= k/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 h= elp 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/37406= 982] 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 feat= ures reproduce: # apt-get install sparse # sparse version: v0.6.1-129-g341daf20-dirty make ARCH=3Dx86_64 allmodconfig make C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag Reported-by: kbuild test robot sparse warnings: (new ones prefixed by >>) >> fs/fsopen.c:116:31: sparse: sparse: incorrect type in argument 1 (differ= ent address spaces) >> fs/fsopen.c:116:31: sparse: expected char const * >> fs/fsopen.c:116:31: sparse: got char const [noderef] *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, unsigne= d 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)) !=3D 0) 100 return -EINVAL; 101 = 102 lookup_flags =3D LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT; 103 if (flags & FSPICK_SYMLINK_NOFOLLOW) 104 lookup_flags &=3D ~LOOKUP_FOLLOW; 105 if (flags & FSPICK_NO_AUTOMOUNT) 106 lookup_flags &=3D ~LOOKUP_AUTOMOUNT; 107 if (flags & FSPICK_EMPTY_PATH) 108 lookup_flags |=3D LOOKUP_EMPTY; 109 = 110 of.lookup_flags =3D lookup_flags; 111 of.intent =3D LOOKUP_OPEN; 112 of.acc_mode =3D 0; 113 of.mode =3D 0; 114 of.open_flag =3D O_PATH; 115 = > 116 name =3D getname_kernel(path); 117 if (IS_ERR(name)) 118 return PTR_ERR(name); 119 = 120 file =3D do_filp_open(dfd, name, &of); 121 putname(name); 122 if (IS_ERR(file)) 123 return PTR_ERR(file); 124 = 125 target =3D &file->f_path; 126 ret =3D -EINVAL; 127 if (target->mnt->mnt_root !=3D target->dentry) 128 goto err_file; 129 = 130 ret =3D fd =3D 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 =3D (struct configfd_param) { 136 .key =3D "pathfd", 137 .file =3D file, 138 .cmd =3D CONFIGFD_SET_FD, 139 }; 140 ret =3D 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 Cen= ter https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corpor= ation --===============4771163422160101657==--