Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [koverstreet-bcachefs:bcachefs-testing 289/299] fs/bcachefs/xattr.c:539:4: error: cannot jump from this goto statement to its label
Date: Sun, 25 May 2025 14:54:44 +0800	[thread overview]
Message-ID: <202505251435.GQfUiwK2-lkp@intel.com> (raw)

tree:   https://github.com/koverstreet/bcachefs bcachefs-testing
head:   38d6d152803440c29cbcc3f7031d5feab5d84c20
commit: 809b2584df1a60e186abbf1666456fa8340aa964 [289/299] bcachefs: convert ei_update_lock to guards
config: arm64-randconfig-004-20250525 (https://download.01.org/0day-ci/archive/20250525/202505251435.GQfUiwK2-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250525/202505251435.GQfUiwK2-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/202505251435.GQfUiwK2-lkp@intel.com/

All errors (new ones prefixed by >>):

>> fs/bcachefs/xattr.c:539:4: error: cannot jump from this goto statement to its label
     539 |                         goto err;
         |                         ^
   fs/bcachefs/xattr.c:565:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
     565 |         guard(mutex)(&inode->ei_update_lock);
         |         ^
   include/linux/cleanup.h:319:15: note: expanded from macro 'guard'
     319 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:166:29: note: expanded from macro '__UNIQUE_ID'
     166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:132:1: note: expanded from here
     132 | __UNIQUE_ID_guard871
         | ^
   fs/bcachefs/xattr.c:535:4: error: cannot jump from this goto statement to its label
     535 |                         goto err;
         |                         ^
   fs/bcachefs/xattr.c:565:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
     565 |         guard(mutex)(&inode->ei_update_lock);
         |         ^
   include/linux/cleanup.h:319:15: note: expanded from macro 'guard'
     319 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:166:29: note: expanded from macro '__UNIQUE_ID'
     166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:132:1: note: expanded from here
     132 | __UNIQUE_ID_guard871
         | ^
   2 errors generated.


vim +539 fs/bcachefs/xattr.c

   496	
   497	static int bch2_xattr_bcachefs_set(const struct xattr_handler *handler,
   498					   struct mnt_idmap *idmap,
   499					   struct dentry *dentry, struct inode *vinode,
   500					   const char *name, const void *value,
   501					   size_t size, int flags)
   502	{
   503		struct bch_inode_info *inode = to_bch_ei(vinode);
   504		struct bch_fs *c = inode->v.i_sb->s_fs_info;
   505		const struct bch_option *opt;
   506		char *buf;
   507		struct inode_opt_set s;
   508		int opt_id, inode_opt_id, ret;
   509	
   510		opt_id = bch2_opt_lookup(name);
   511		if (opt_id < 0)
   512			return -EINVAL;
   513	
   514		opt = bch2_opt_table + opt_id;
   515	
   516		inode_opt_id = opt_to_inode_opt(opt_id);
   517		if (inode_opt_id < 0)
   518			return -EINVAL;
   519	
   520		s.id = inode_opt_id;
   521	
   522		if (value) {
   523			u64 v = 0;
   524	
   525			buf = kmalloc(size + 1, GFP_KERNEL);
   526			if (!buf)
   527				return -ENOMEM;
   528			memcpy(buf, value, size);
   529			buf[size] = '\0';
   530	
   531			ret = bch2_opt_parse(c, opt, buf, &v, NULL);
   532			kfree(buf);
   533	
   534			if (ret < 0)
   535				goto err;
   536	
   537			ret = bch2_opt_hook_pre_set(c, NULL, opt_id, v);
   538			if (ret < 0)
 > 539				goto err;
   540	
   541			s.v = v + 1;
   542			s.defined = true;
   543		} else {
   544			/*
   545			 * Check if this option was set on the parent - if so, switched
   546			 * back to inheriting from the parent:
   547			 *
   548			 * rename() also has to deal with keeping inherited options up
   549			 * to date - see bch2_reinherit_attrs()
   550			 */
   551			spin_lock(&dentry->d_lock);
   552			if (!IS_ROOT(dentry)) {
   553				struct bch_inode_info *dir =
   554					to_bch_ei(d_inode(dentry->d_parent));
   555	
   556				s.v = bch2_inode_opt_get(&dir->ei_inode, inode_opt_id);
   557			} else {
   558				s.v = 0;
   559			}
   560			spin_unlock(&dentry->d_lock);
   561	
   562			s.defined = false;
   563		}
   564	
   565		guard(mutex)(&inode->ei_update_lock);
   566		if (inode_opt_id == Inode_opt_project) {
   567			/*
   568			 * inode fields accessible via the xattr interface are stored
   569			 * with a +1 bias, so that 0 means unset:
   570			 */
   571			ret = bch2_set_projid(c, inode, s.v ? s.v - 1 : 0);
   572			if (ret)
   573				goto err;
   574		}
   575	
   576		ret = bch2_write_inode(c, inode, inode_opt_set_fn, &s, 0);
   577	err:
   578		return bch2_err_class(ret);
   579	}
   580	

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

                 reply	other threads:[~2025-05-25  6:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202505251435.GQfUiwK2-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kent.overstreet@linux.dev \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox