Skip to contentSkip to conversation

kernel/cgroup/cpuset-v1.c:397:18: error: implicit declaration of function 'cgroup_path_ns_locked'; did you mean 'cgroup_path_ns'?

PATCH kernel test robot 4 participants 4 messages Jan 17, 2025 – Jan 20, 2025 cgroup

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-next
head:   03a12b026323247a320495fed3719d39cffdbe9b
commit: 03a12b026323247a320495fed3719d39cffdbe9b [5/5] cgroup/cpuset: Move procfs cpuset attribute under cgroup-v1.c
config: x86_64-buildonly-randconfig-006-20250118 (https://download.01.org/0day-ci/archive/20250118/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250118/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

kernel/cgroup/cpuset-v1.c: In function 'proc_cpuset_show':

>> kernel/cgroup/cpuset-v1.c:397:18: error: implicit declaration of function 'cgroup_path_ns_locked'; did you mean 'cgroup_path_ns'? [-Werror=implicit-function-declaration]
     397 |         retval = cgroup_path_ns_locked(css->cgroup, buf, PATH_MAX,
         |                  ^~~~~~~~~~~~~~~~~~~~~
         |                  cgroup_path_ns

cc1: some warnings being treated as errors

vim +397 kernel/cgroup/cpuset-v1.c

375
376 #ifdef CONFIG_PROC_PID_CPUSET
377 /*
378 * proc_cpuset_show()
379 * - Print tasks cpuset path into seq_file.
380 * - Used for /proc/<pid>/cpuset.
381 */
382 int proc_cpuset_show(struct seq_file *m, struct pid_namespace *ns,
383 struct pid *pid, struct task_struct *tsk)
384 {
385 char *buf;
386 struct cgroup_subsys_state *css;
387 int retval;
388
389 retval = -ENOMEM;
390 buf = kmalloc(PATH_MAX, GFP_KERNEL);
391 if (!buf)
392 goto out;
393
394 rcu_read_lock();
395 spin_lock_irq(&css_set_lock);
396 css = task_css(tsk, cpuset_cgrp_id);

 > 397		retval = cgroup_path_ns_locked(css->cgroup, buf, PATH_MAX,

398 current->nsproxy->cgroup_ns);
399 spin_unlock_irq(&css_set_lock);
400 rcu_read_unlock();
401
402 if (retval == -E2BIG)
403 retval = -ENAMETOOLONG;
404 if (retval < 0)
405 goto out_free;
406 seq_puts(m, buf);
407 seq_putc(m, '\n');
408 retval = 0;
409 out_free:
410 kfree(buf);
411 out:
412 return retval;
413 }
414 #endif /* CONFIG_PROC_PID_CPUSET */
415

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw
Quoted 57 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-next
head:   03a12b026323247a320495fed3719d39cffdbe9b
commit: 03a12b026323247a320495fed3719d39cffdbe9b [5/5] cgroup/cpuset: Move procfs cpuset attribute under cgroup-v1.c
config: x86_64-buildonly-randconfig-006-20250118 (https://download.01.org/0day-ci/archive/20250118/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250118/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

kernel/cgroup/cpuset-v1.c: In function 'proc_cpuset_show':

Quoted 1 line
Quoted 1 line

kernel/cgroup/cpuset-v1.c:397:18: error: implicit declaration of function 'cgroup_path_ns_locked'; did you mean 'cgroup_path_ns'? [-Werror=implicit-function-declaration]

      397 |         retval = cgroup_path_ns_locked(css->cgroup, buf, PATH_MAX,
          |                  ^~~~~~~~~~~~~~~~~~~~~
          |                  cgroup_path_ns

cc1: some warnings being treated as errors

vim +397 kernel/cgroup/cpuset-v1.c

    375	
    376	#ifdef CONFIG_PROC_PID_CPUSET
    377	/*
    378	 * proc_cpuset_show()
    379	 *  - Print tasks cpuset path into seq_file.
    380	 *  - Used for /proc/<pid>/cpuset.
    381	 */
    382	int proc_cpuset_show(struct seq_file *m, struct pid_namespace *ns,
    383			     struct pid *pid, struct task_struct *tsk)
    384	{
    385		char *buf;
    386		struct cgroup_subsys_state *css;
    387		int retval;
    388	
    389		retval = -ENOMEM;
    390		buf = kmalloc(PATH_MAX, GFP_KERNEL);
    391		if (!buf)
    392			goto out;
    393	
    394		rcu_read_lock();
    395		spin_lock_irq(&css_set_lock);
    396		css = task_css(tsk, cpuset_cgrp_id);
Quoted 1 line

397 retval = cgroup_path_ns_locked(css->cgroup, buf, PATH_MAX,

    398					       current->nsproxy->cgroup_ns);
    399		spin_unlock_irq(&css_set_lock);
    400		rcu_read_unlock();
    401	
    402		if (retval == -E2BIG)
    403			retval = -ENAMETOOLONG;
    404		if (retval < 0)
    405			goto out_free;
    406		seq_puts(m, buf);
    407		seq_putc(m, '\n');
Quoted 9 lines
    408		retval = 0;
    409	out_free:
    410		kfree(buf);
    411	out:
    412		return retval;
    413	}
    414	#endif /* CONFIG_PROC_PID_CPUSET */
    415	

Now cpuset-v1.c needs to include "cgroup-internal.h".

Cheers,
Longman

maintainer
#2 lore raw

Dropped the patch for now. Michal, can you please send an updated version?

Thanks.

Signature · 1 line
tejun
maintainer
#3 lore raw
Quoted 1 line · Tejun Heo

Dropped the patch for now. Michal, can you please send an updated version?

Sorry for complications. (Despite I tested both configs, I forgot about some caching in my test setup and missed the build failure.)

I've sent out v3.

Michal