* [brauner:clone_into_cgroup 2/3] kernel/cgroup/cgroup.c:5930:3: warning: ignoring return value of 'mutex_lock_killable', declared with attribute warn_unused_result
@ 2019-12-23 3:31 kbuild test robot
0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-12-23 3:31 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 4327 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git clone_into_cgroup
head: fc5f569c2dad303ee4cc0d0625ce234e73bcda44
commit: 51e007bbe308fa2c70119c65d6845a2af72e533b [2/3] clone3: allow spawning processes into cgroups
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 51e007bbe308fa2c70119c65d6845a2af72e533b
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
kernel/cgroup/cgroup.c: In function 'cgroup_css_set_fork':
>> kernel/cgroup/cgroup.c:5930:3: warning: ignoring return value of 'mutex_lock_killable', declared with attribute warn_unused_result [-Wunused-result]
mutex_lock_killable(&cgroup_mutex);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/mutex_lock_killable +5930 kernel/cgroup/cgroup.c
5902
5903 /**
5904 * cgroup_css_set_fork - find or create a css_set for a child process
5905 * @parent: the parent of the child process
5906 * @kargs: the arguments passed to create the child process
5907 *
5908 * This functions finds or creates a new css_set which the child
5909 * process will be attached to in cgroup_post_fork(). By default,
5910 * the child process will be given the same css_set as its parent.
5911 *
5912 * If CLONE_INTO_CGROUP is specified this function will try to find an
5913 * existing css_set which includes the request cgorup and if not create
5914 * new css_set that the child will be attached to. After this function
5915 * returns when CLONE_INTO_CGROUP is used we will hold a reference to the
5916 * target cgroup. This is done so we can check whether the cgroup is
5917 * still alive right before we enter fork()'s point of no return.
5918 */
5919 static int cgroup_css_set_fork(struct task_struct *parent,
5920 struct kernel_clone_args *kargs)
5921 __acquires(&cgroup_mutex) __acquires(&cgroup_threadgroup_rwsem)
5922 {
5923 int ret;
5924 struct cgroup *dst_cgrp = NULL, *src_cgrp;
5925 struct css_set *cset;
5926 struct super_block *sb;
5927 struct file *f;
5928
5929 if (kargs->flags & CLONE_INTO_CGROUP)
> 5930 mutex_lock_killable(&cgroup_mutex);
5931
5932 cgroup_threadgroup_change_begin(parent);
5933
5934 spin_lock_irq(&css_set_lock);
5935 cset = task_css_set(parent);
5936 get_css_set(cset);
5937 spin_unlock_irq(&css_set_lock);
5938
5939 if (!(kargs->flags & CLONE_INTO_CGROUP)) {
5940 kargs->cset = cset;
5941 return 0;
5942 }
5943
5944 f = fget_raw(kargs->cgroup);
5945 if (!f) {
5946 ret = -EBADF;
5947 goto err;
5948 }
5949 sb = f->f_path.dentry->d_sb;
5950
5951 dst_cgrp = cgroup_get_from_file(f);
5952 if (IS_ERR(dst_cgrp)) {
5953 ret = PTR_ERR(dst_cgrp);
5954 goto err;
5955 }
5956
5957 spin_lock_irq(&css_set_lock);
5958 src_cgrp = task_cgroup_from_root(parent, &cgrp_dfl_root);
5959 spin_unlock_irq(&css_set_lock);
5960
5961 ret = cgroup_attach_permissions(src_cgrp, dst_cgrp, sb,
5962 !!(kargs->flags & CLONE_THREAD));
5963 if (ret)
5964 goto err;
5965
5966 kargs->cset = find_css_set(cset, dst_cgrp);
5967 if (!kargs->cset) {
5968 ret = -ENOMEM;
5969 goto err;
5970 }
5971
5972 if (cgroup_is_dead(dst_cgrp)) {
5973 ret = -ENODEV;
5974 goto err;
5975 }
5976
5977 put_css_set(cset);
5978 fput(f);
5979 kargs->cgrp = dst_cgrp;
5980 return ret;
5981
5982 err:
5983 cgroup_threadgroup_change_end(parent);
5984 mutex_unlock(&cgroup_mutex);
5985 if (f)
5986 fput(f);
5987 if (dst_cgrp)
5988 cgroup_put(dst_cgrp);
5989 put_css_set(cset);
5990 return ret;
5991 }
5992
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 51876 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-12-23 3:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-23 3:31 [brauner:clone_into_cgroup 2/3] kernel/cgroup/cgroup.c:5930:3: warning: ignoring return value of 'mutex_lock_killable', declared with attribute warn_unused_result kbuild test robot
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.