Hi "Yordan,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on linux/master]
[also build test WARNING on hnaz-mm/master linus/master v5.16-rc1 next-20211118]
[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/Yordan-Karadzhov-VMware/namespac...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
8ab774587903771821b59471cc723bba6d893942
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
#
https://github.com/0day-ci/linux/commit/9b9ee11c1c806bd636fd81cd55b93f203...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Yordan-Karadzhov-VMware/namespacefs-Proof-of-Concept/20211119-021813
git checkout 9b9ee11c1c806bd636fd81cd55b93f2034f0d1a0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
fs/namespacefs/inode.c:161:1: warning: no previous prototype for
'namespacefs_create_file' [-Wmissing-prototypes]
161 | namespacefs_create_file(const char *name, struct dentry *parent,
| ^~~~~~~~~~~~~~~~~~~~~~~
fs/namespacefs/inode.c:170:1: warning: no previous prototype for
'namespacefs_create_dir' [-Wmissing-prototypes]
170 | namespacefs_create_dir(const char *name, struct dentry *parent,
| ^~~~~~~~~~~~~~~~~~~~~~
fs/namespacefs/inode.c:181:6: warning: no previous prototype for
'namespacefs_remove_dir' [-Wmissing-prototypes]
181 | void namespacefs_remove_dir(struct dentry *dentry)
| ^~~~~~~~~~~~~~~~~~~~~~
> fs/namespacefs/inode.c:286:5: warning: no previous prototype for
'namespacefs_create_pid_ns_dir' [-Wmissing-prototypes]
286 | int
namespacefs_create_pid_ns_dir(struct pid_namespace *ns)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> fs/namespacefs/inode.c:305:6: warning: no previous prototype for
'namespacefs_remove_pid_ns_dir' [-Wmissing-prototypes]
305 | void
namespacefs_remove_pid_ns_dir(struct pid_namespace *ns)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/namespacefs_create_pid_ns_dir +286 fs/namespacefs/inode.c
159
160 struct dentry *
161 namespacefs_create_file(const char *name, struct dentry *parent,
162 const struct user_namespace *user_ns,
163 const struct file_operations *fops,
164 void *data)
165 {
166 return create(name, parent, user_ns, fops, data);
167 }
168
169 struct dentry *
170 namespacefs_create_dir(const char *name, struct dentry *parent,
171 const struct user_namespace *user_ns)
172 {
173 return create(name, parent, user_ns, NULL, NULL);
174 }
175
176 static void remove_one(struct dentry *d)
177 {
178 release_namespacefs();
179 }
180
181 void namespacefs_remove_dir(struct dentry *dentry)
182 {
183 if (IS_ERR_OR_NULL(dentry))
184 return;
185
186 if (pin_fs())
187 return;
188
189 simple_recursive_removal(dentry, remove_one);
190 release_namespacefs();
191 }
192
193 struct idr_seq_context {
194 struct idr *idr;
195 int index;
196 };
197
198 static void *idr_seq_get_next(struct idr_seq_context *idr_ctx, loff_t *pos)
199 {
200 void *next = idr_get_next(idr_ctx->idr, &idr_ctx->index);
201
202 *pos = ++idr_ctx->index;
203 return next;
204 }
205
206 static void *idr_seq_start(struct seq_file *m, loff_t *pos)
207 {
208 struct idr_seq_context *idr_ctx = m->private;
209
210 idr_lock(idr_ctx->idr);
211 idr_ctx->index = *pos;
212 return idr_seq_get_next(idr_ctx, pos);
213 }
214
215 static void *idr_seq_next(struct seq_file *m, void *v, loff_t *pos)
216 {
217 return idr_seq_get_next(m->private, pos);
218 }
219
220 static void idr_seq_stop(struct seq_file *m, void *p)
221 {
222 struct idr_seq_context *idr_ctx = m->private;
223
224 idr_unlock(idr_ctx->idr);
225 }
226
227 static int idr_seq_open(struct file *file, struct idr *idr,
228 const struct seq_operations *ops)
229 {
230 struct idr_seq_context *idr_ctx;
231
232 idr_ctx = __seq_open_private(file, ops, sizeof(*idr_ctx));
233 if (!idr_ctx)
234 return -ENOMEM;
235
236 idr_ctx->idr = idr;
237
238 return 0;
239 }
240
241 static inline int pid_seq_show(struct seq_file *m, void *v)
242 {
243 struct pid *pid = v;
244
245 seq_printf(m, "%d\n", pid_nr(pid));
246 return 0;
247 }
248
249 static const struct seq_operations pid_seq_ops = {
250 .start = idr_seq_start,
251 .next = idr_seq_next,
252 .stop = idr_seq_stop,
253 .show = pid_seq_show,
254 };
255
256 static int pid_seq_open(struct inode *inode, struct file *file)
257 {
258 struct idr *idr = inode->i_private;
259
260 return idr_seq_open(file, idr, &pid_seq_ops);
261 }
262
263 static const struct file_operations tasks_fops = {
264 .open = pid_seq_open,
265 .read = seq_read,
266 .llseek = seq_lseek,
267 .release = seq_release_private,
268 };
269
270 static int create_inode_dir(struct ns_common *ns, struct dentry *parent_dentry,
271 const struct user_namespace *user_ns)
272 {
273 char *dir = kasprintf(GFP_KERNEL, "%u", ns->inum);
274
275 if (!dir)
276 return -ENOMEM;
277
278 ns->dentry = namespacefs_create_dir(dir, parent_dentry, user_ns);
279 kfree(dir);
280 if (IS_ERR(ns->dentry))
281 return PTR_ERR(ns->dentry);
282
283 return 0;
284 }
285
286 int namespacefs_create_pid_ns_dir(struct pid_namespace *ns)
287 {
288 struct dentry *dentry;
289 int err;
290
291 err = create_inode_dir(&ns->ns, ns->parent->ns.dentry,
ns->user_ns);
292 if (err)
293 return err;
294
295 dentry = namespacefs_create_file("tasks", ns->ns.dentry,
ns->user_ns,
296 &tasks_fops, &ns->idr);
297 if (IS_ERR(dentry)) {
298 dput(ns->ns.dentry);
299 return PTR_ERR(dentry);
300 }
301
302 return 0;
303 }
304
305 void namespacefs_remove_pid_ns_dir(struct pid_namespace *ns)
306 {
307 namespacefs_remove_dir(ns->ns.dentry);
308 }
309
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org