public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [PATCH v3 1/1] pidfd: implement PIDFD_THREAD flag for pidfd_open()
       [not found] <20240131132602.GA23641@redhat.com>
@ 2024-02-01  7:23 ` kernel test robot
  2024-02-01  8:47   ` Oleg Nesterov
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2024-02-01  7:23 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: llvm, oe-kbuild-all

Hi Oleg,

kernel test robot noticed the following build warnings:

[auto build test WARNING on brauner-vfs/vfs.all]
[cannot apply to kees/for-next/execve linus/master v6.8-rc2 next-20240201]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Oleg-Nesterov/pidfd-implement-PIDFD_THREAD-flag-for-pidfd_open/20240131-213408
base:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.all
patch link:    https://lore.kernel.org/r/20240131132602.GA23641%40redhat.com
patch subject: [PATCH v3 1/1] pidfd: implement PIDFD_THREAD flag for pidfd_open()
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20240201/202402011558.BUpYBZyG-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240201/202402011558.BUpYBZyG-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402011558.BUpYBZyG-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> kernel/fork.c:2201:70: warning: if statement has empty body [-Wempty-body]
    2201 |         if (!pid || !pid_has_task(pid, thread ? PIDTYPE_PID : PIDTYPE_TGID));
         |                                                                             ^
   kernel/fork.c:2201:70: note: put the semicolon on a separate line to silence this warning
   1 warning generated.


vim +2201 kernel/fork.c

  2169	
  2170	/**
  2171	 * pidfd_prepare - allocate a new pidfd_file and reserve a pidfd
  2172	 * @pid:   the struct pid for which to create a pidfd
  2173	 * @flags: flags of the new @pidfd
  2174	 * @ret: Where to return the pidfd.
  2175	 *
  2176	 * Allocate a new file that stashes @pid and reserve a new pidfd number in the
  2177	 * caller's file descriptor table. The pidfd is reserved but not installed yet.
  2178	 *
  2179	 * The helper verifies that @pid is still in use, without PIDFD_THREAD the
  2180	 * task identified by @pid must be a thread-group leader.
  2181	 *
  2182	 * If this function returns successfully the caller is responsible to either
  2183	 * call fd_install() passing the returned pidfd and pidfd file as arguments in
  2184	 * order to install the pidfd into its file descriptor table or they must use
  2185	 * put_unused_fd() and fput() on the returned pidfd and pidfd file
  2186	 * respectively.
  2187	 *
  2188	 * This function is useful when a pidfd must already be reserved but there
  2189	 * might still be points of failure afterwards and the caller wants to ensure
  2190	 * that no pidfd is leaked into its file descriptor table.
  2191	 *
  2192	 * Return: On success, a reserved pidfd is returned from the function and a new
  2193	 *         pidfd file is returned in the last argument to the function. On
  2194	 *         error, a negative error code is returned from the function and the
  2195	 *         last argument remains unchanged.
  2196	 */
  2197	int pidfd_prepare(struct pid *pid, unsigned int flags, struct file **ret)
  2198	{
  2199		bool thread = flags & PIDFD_THREAD;
  2200	
> 2201		if (!pid || !pid_has_task(pid, thread ? PIDTYPE_PID : PIDTYPE_TGID));
  2202			return -EINVAL;
  2203	
  2204		return __pidfd_prepare(pid, flags, ret);
  2205	}
  2206	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v3 1/1] pidfd: implement PIDFD_THREAD flag for pidfd_open()
  2024-02-01  7:23 ` [PATCH v3 1/1] pidfd: implement PIDFD_THREAD flag for pidfd_open() kernel test robot
@ 2024-02-01  8:47   ` Oleg Nesterov
  0 siblings, 0 replies; 2+ messages in thread
From: Oleg Nesterov @ 2024-02-01  8:47 UTC (permalink / raw)
  To: kernel test robot; +Cc: llvm, oe-kbuild-all

I guess I do not really need to reply, but just in case...

On 02/01, kernel test robot wrote:
>
> >> kernel/fork.c:2201:70: warning: if statement has empty body [-Wempty-body]
>     2201 |         if (!pid || !pid_has_task(pid, thread ? PIDTYPE_PID : PIDTYPE_TGID));
>          |                                                                             ^
>    kernel/fork.c:2201:70: note: put the semicolon on a separate line to silence this warning
>    1 warning generated.

Yes, thank you dear Kernel Test Robot, this was already fixed
by Tycho.

Oleg.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-01  8:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240131132602.GA23641@redhat.com>
2024-02-01  7:23 ` [PATCH v3 1/1] pidfd: implement PIDFD_THREAD flag for pidfd_open() kernel test robot
2024-02-01  8:47   ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox