All of lore.kernel.org
 help / color / mirror / Atom feed
* fs/overlayfs/util.c:466:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG.
@ 2020-12-07 20:35 kernel test robot
  2020-12-07 20:35 ` [PATCH] ovl: fix bugon.cocci warnings kernel test robot
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2020-12-07 20:35 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Miklos Szeredi <mszeredi@redhat.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0477e92881850d44910a7e94fc2c46f96faa131f
commit: 56230d956739b9cb1cbde439d76227d77979a04d ovl: verify permissions in ovl_path_open()
date:   6 months ago
:::::: branch date: 22 hours ago
:::::: commit date: 6 months ago
config: xtensa-randconfig-c004-20201207 (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


"coccinelle warnings: (new ones prefixed by >>)"
>> fs/overlayfs/util.c:466:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG.
   Please make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h)

Please review and possibly fold the followup patch.

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

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

* [PATCH] ovl: fix bugon.cocci warnings
  2020-12-07 20:35 fs/overlayfs/util.c:466:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
@ 2020-12-07 20:35 ` kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-12-07 20:35 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Miklos Szeredi <mszeredi@redhat.com>
CC: linux-unionfs(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

fs/overlayfs/util.c:466:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG.
Please make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h)

 Use BUG_ON instead of a if condition followed by BUG.

Semantic patch information:
 This makes an effort to find cases where BUG() follows an if
 condition on an expression and replaces the if condition and BUG()
 with a BUG_ON having the conditional expression of the if statement
 as argument.

Generated by: scripts/coccinelle/misc/bugon.cocci

Fixes: 56230d956739 ("ovl: verify permissions in ovl_path_open()")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0477e92881850d44910a7e94fc2c46f96faa131f
commit: 56230d956739b9cb1cbde439d76227d77979a04d ovl: verify permissions in ovl_path_open()
:::::: branch date: 22 hours ago
:::::: commit date: 6 months ago

Please take the patch only if it's a positive warning. Thanks!

 util.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -462,8 +462,7 @@ struct file *ovl_path_open(struct path *
 	struct inode *inode = d_inode(path->dentry);
 	int err, acc_mode;
 
-	if (flags & ~(O_ACCMODE | O_LARGEFILE))
-		BUG();
+	BUG_ON(flags & ~(O_ACCMODE | O_LARGEFILE));
 
 	switch (flags & O_ACCMODE) {
 	case O_RDONLY:

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

* [PATCH] ovl: fix bugon.cocci warnings
  2020-06-03 12:00 [miklos-vfs:overlayfs-next 20/29] fs/overlayfs/util.c:466:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
@ 2020-06-03 12:00 ` kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-06-03 12:00 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-unionfs(a)vger.kernel.org
TO: "Miklos, Szeredi," <mszeredi@redhat.com>
CC: Miklos Szeredi <miklos@szeredi.hu>
CC: linux-unionfs(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

fs/overlayfs/util.c:466:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG.
Please make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h)

 Use BUG_ON instead of a if condition followed by BUG.

Semantic patch information:
 This makes an effort to find cases where BUG() follows an if
 condition on an expression and replaces the if condition and BUG()
 with a BUG_ON having the conditional expression of the if statement
 as argument.

Generated by: scripts/coccinelle/misc/bugon.cocci

Fixes: 56230d956739 ("ovl: verify permissions in ovl_path_open()")
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git overlayfs-next
head:   eda618726c0b174a111b6414e40593ff090442b3
commit: 56230d956739b9cb1cbde439d76227d77979a04d [20/29] ovl: verify permissions in ovl_path_open()
:::::: branch date: 4 hours ago
:::::: commit date: 16 hours ago

Please take the patch only if it's a positive warning. Thanks!

 util.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -462,8 +462,7 @@ struct file *ovl_path_open(struct path *
 	struct inode *inode = d_inode(path->dentry);
 	int err, acc_mode;
 
-	if (flags & ~(O_ACCMODE | O_LARGEFILE))
-		BUG();
+	BUG_ON(flags & ~(O_ACCMODE | O_LARGEFILE));
 
 	switch (flags & O_ACCMODE) {
 	case O_RDONLY:

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

end of thread, other threads:[~2020-12-07 20:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 20:35 fs/overlayfs/util.c:466:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
2020-12-07 20:35 ` [PATCH] ovl: fix bugon.cocci warnings kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2020-06-03 12:00 [miklos-vfs:overlayfs-next 20/29] fs/overlayfs/util.c:466:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG kernel test robot
2020-06-03 12:00 ` [PATCH] ovl: fix bugon.cocci warnings kernel 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.