From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC PATCH 2/4] namespacefs: Add methods to create/remove PID namespace directories
Date: Fri, 19 Nov 2021 08:10:56 +0800 [thread overview]
Message-ID: <202111190819.tvU7LXQ6-lkp@intel.com> (raw)
In-Reply-To: <20211118181210.281359-3-y.karadz@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 7168 bytes --]
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/namespacefs-Proof-of-Concept/20211119-021813
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/9b9ee11c1c806bd636fd81cd55b93f2034f0d1a0
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@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(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 62413 bytes --]
next prev parent reply other threads:[~2021-11-19 0:10 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 18:12 [RFC PATCH 0/4] namespacefs: Proof-of-Concept Yordan Karadzhov (VMware)
2021-11-18 18:12 ` [RFC PATCH 1/4] namespacefs: Introduce 'namespacefs' Yordan Karadzhov (VMware)
2021-11-18 21:22 ` kernel test robot
2021-11-18 18:12 ` [RFC PATCH 2/4] namespacefs: Add methods to create/remove PID namespace directories Yordan Karadzhov (VMware)
2021-11-19 0:10 ` kernel test robot [this message]
2021-11-18 18:12 ` [RFC PATCH 3/4] namespacefs: Couple namespacefs to the PID namespace Yordan Karadzhov (VMware)
2021-11-18 18:12 ` [RFC PATCH 4/4] namespacefs: Couple namespacefs to the UTS namespace Yordan Karadzhov (VMware)
2021-11-19 2:24 ` kernel test robot
2021-11-18 18:55 ` [RFC PATCH 0/4] namespacefs: Proof-of-Concept Eric W. Biederman
2021-11-18 19:02 ` Steven Rostedt
2021-11-18 19:22 ` Eric W. Biederman
2021-11-18 19:36 ` Steven Rostedt
2021-11-18 19:24 ` Steven Rostedt
2021-11-19 9:50 ` Kirill Tkhai
2021-11-19 12:45 ` James Bottomley
2021-11-19 14:27 ` Steven Rostedt
2021-11-19 16:42 ` James Bottomley
2021-11-19 17:14 ` Yordan Karadzhov
2021-11-19 17:22 ` Steven Rostedt
2021-11-19 23:22 ` James Bottomley
2021-11-20 0:07 ` Steven Rostedt
2021-11-20 0:14 ` James Bottomley
[not found] ` <f6ca1f5bdb3b516688f291d9685a6a59f49f1393.camel@HansenPartnership.com>
2021-11-19 16:47 ` Steven Rostedt
2021-11-19 16:49 ` Steven Rostedt
2021-11-19 23:08 ` James Bottomley
2021-11-22 13:02 ` Yordan Karadzhov
2021-11-22 13:44 ` James Bottomley
2021-11-22 15:00 ` Yordan Karadzhov
2021-11-22 15:47 ` James Bottomley
2021-11-22 16:15 ` Yordan Karadzhov
2021-11-19 14:26 ` Yordan Karadzhov
2021-11-18 21:24 ` Mike Rapoport
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=202111190819.tvU7LXQ6-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.