All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: qiang.zhang@windriver.com, axboe@kernel.dk, viro@zeniv.linux.org.uk
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] eventfd: convert global percpu eventfd_wake_count to ctx percpu eventfd_wake_count
Date: Fri, 4 Jun 2021 21:21:31 +0800	[thread overview]
Message-ID: <202106042122.ep6jNYuE-lkp@intel.com> (raw)
In-Reply-To: <20210604074212.17808-1-qiang.zhang@windriver.com>

[-- Attachment #1: Type: text/plain, Size: 3871 bytes --]

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.13-rc4 next-20210604]
[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/qiang-zhang-windriver-com/eventfd-convert-global-percpu-eventfd_wake_count-to-ctx-percpu-eventfd_wake_count/20210604-154249
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f88cd3fb9df228e5ce4e13ec3dbad671ddb2146e
config: arm64-randconfig-r013-20210604 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 5c0d1b2f902aa6a9cf47cc7e42c5b83bb2217cf9)
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
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/0day-ci/linux/commit/3cff73140b2b518eec3e30712d9c66bbde8ad375
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review qiang-zhang-windriver-com/eventfd-convert-global-percpu-eventfd_wake_count-to-ctx-percpu-eventfd_wake_count/20210604-154249
        git checkout 3cff73140b2b518eec3e30712d9c66bbde8ad375
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 

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/eventfd.c:434:6: warning: variable 'fd' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!ctx->eventfd_wake_count)
               ^~~~~~~~~~~~~~~~~~~~~~~~
   fs/eventfd.c:461:9: note: uninitialized use occurs here
           return fd;
                  ^~
   fs/eventfd.c:434:2: note: remove the 'if' if its condition is always false
           if (!ctx->eventfd_wake_count)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/eventfd.c:420:8: note: initialize the variable 'fd' to silence this warning
           int fd;
                 ^
                  = 0
   1 warning generated.


vim +434 fs/eventfd.c

   415	
   416	static int do_eventfd(unsigned int count, int flags)
   417	{
   418		struct eventfd_ctx *ctx;
   419		struct file *file;
   420		int fd;
   421	
   422		/* Check the EFD_* constants for consistency.  */
   423		BUILD_BUG_ON(EFD_CLOEXEC != O_CLOEXEC);
   424		BUILD_BUG_ON(EFD_NONBLOCK != O_NONBLOCK);
   425	
   426		if (flags & ~EFD_FLAGS_SET)
   427			return -EINVAL;
   428	
   429		ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
   430		if (!ctx)
   431			return -ENOMEM;
   432	
   433		ctx->eventfd_wake_count = alloc_percpu(int);
 > 434		if (!ctx->eventfd_wake_count)
   435			goto err;
   436	
   437		kref_init(&ctx->kref);
   438		init_waitqueue_head(&ctx->wqh);
   439		ctx->count = count;
   440		ctx->flags = flags;
   441		ctx->id = ida_simple_get(&eventfd_ida, 0, 0, GFP_KERNEL);
   442	
   443		flags &= EFD_SHARED_FCNTL_FLAGS;
   444		flags |= O_RDWR;
   445		fd = get_unused_fd_flags(flags);
   446		if (fd < 0)
   447			goto err;
   448	
   449		file = anon_inode_getfile("[eventfd]", &eventfd_fops, ctx, flags);
   450		if (IS_ERR(file)) {
   451			put_unused_fd(fd);
   452			fd = PTR_ERR(file);
   453			goto err;
   454		}
   455	
   456		file->f_mode |= FMODE_NOWAIT;
   457		fd_install(fd, file);
   458		return fd;
   459	err:
   460		eventfd_free_ctx(ctx);
   461		return fd;
   462	}
   463	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38795 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] eventfd: convert global percpu eventfd_wake_count to ctx percpu eventfd_wake_count
Date: Fri, 04 Jun 2021 21:21:31 +0800	[thread overview]
Message-ID: <202106042122.ep6jNYuE-lkp@intel.com> (raw)
In-Reply-To: <20210604074212.17808-1-qiang.zhang@windriver.com>

[-- Attachment #1: Type: text/plain, Size: 3975 bytes --]

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.13-rc4 next-20210604]
[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/qiang-zhang-windriver-com/eventfd-convert-global-percpu-eventfd_wake_count-to-ctx-percpu-eventfd_wake_count/20210604-154249
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f88cd3fb9df228e5ce4e13ec3dbad671ddb2146e
config: arm64-randconfig-r013-20210604 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 5c0d1b2f902aa6a9cf47cc7e42c5b83bb2217cf9)
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
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/0day-ci/linux/commit/3cff73140b2b518eec3e30712d9c66bbde8ad375
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review qiang-zhang-windriver-com/eventfd-convert-global-percpu-eventfd_wake_count-to-ctx-percpu-eventfd_wake_count/20210604-154249
        git checkout 3cff73140b2b518eec3e30712d9c66bbde8ad375
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 

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/eventfd.c:434:6: warning: variable 'fd' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!ctx->eventfd_wake_count)
               ^~~~~~~~~~~~~~~~~~~~~~~~
   fs/eventfd.c:461:9: note: uninitialized use occurs here
           return fd;
                  ^~
   fs/eventfd.c:434:2: note: remove the 'if' if its condition is always false
           if (!ctx->eventfd_wake_count)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/eventfd.c:420:8: note: initialize the variable 'fd' to silence this warning
           int fd;
                 ^
                  = 0
   1 warning generated.


vim +434 fs/eventfd.c

   415	
   416	static int do_eventfd(unsigned int count, int flags)
   417	{
   418		struct eventfd_ctx *ctx;
   419		struct file *file;
   420		int fd;
   421	
   422		/* Check the EFD_* constants for consistency.  */
   423		BUILD_BUG_ON(EFD_CLOEXEC != O_CLOEXEC);
   424		BUILD_BUG_ON(EFD_NONBLOCK != O_NONBLOCK);
   425	
   426		if (flags & ~EFD_FLAGS_SET)
   427			return -EINVAL;
   428	
   429		ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
   430		if (!ctx)
   431			return -ENOMEM;
   432	
   433		ctx->eventfd_wake_count = alloc_percpu(int);
 > 434		if (!ctx->eventfd_wake_count)
   435			goto err;
   436	
   437		kref_init(&ctx->kref);
   438		init_waitqueue_head(&ctx->wqh);
   439		ctx->count = count;
   440		ctx->flags = flags;
   441		ctx->id = ida_simple_get(&eventfd_ida, 0, 0, GFP_KERNEL);
   442	
   443		flags &= EFD_SHARED_FCNTL_FLAGS;
   444		flags |= O_RDWR;
   445		fd = get_unused_fd_flags(flags);
   446		if (fd < 0)
   447			goto err;
   448	
   449		file = anon_inode_getfile("[eventfd]", &eventfd_fops, ctx, flags);
   450		if (IS_ERR(file)) {
   451			put_unused_fd(fd);
   452			fd = PTR_ERR(file);
   453			goto err;
   454		}
   455	
   456		file->f_mode |= FMODE_NOWAIT;
   457		fd_install(fd, file);
   458		return fd;
   459	err:
   460		eventfd_free_ctx(ctx);
   461		return fd;
   462	}
   463	

---
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: 38795 bytes --]

  reply	other threads:[~2021-06-04 13:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04  7:42 [PATCH] eventfd: convert global percpu eventfd_wake_count to ctx percpu eventfd_wake_count qiang.zhang
2021-06-04 13:21 ` kernel test robot [this message]
2021-06-04 13:21   ` kernel test robot
2021-06-04 15:03 ` kernel test robot
2021-06-04 15:03   ` kernel test robot
2021-06-07  3:40 ` Zhang, Qiang

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=202106042122.ep6jNYuE-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=axboe@kernel.dk \
    --cc=clang-built-linux@googlegroups.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qiang.zhang@windriver.com \
    --cc=viro@zeniv.linux.org.uk \
    /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.