llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [koverstreet-bcachefs:bcachefs-testing 237/239] fs/bcachefs/namei.c:763:3: error: cannot jump from this goto statement to its label
@ 2025-07-31 23:01 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-07-31 23:01 UTC (permalink / raw)
  To: Kent Overstreet; +Cc: llvm, oe-kbuild-all

tree:   https://github.com/koverstreet/bcachefs bcachefs-testing
head:   474062e5a3c6cec1b36d6d5df81a4750b8b6d6d0
commit: 0bb43b0a96be30cb01f9f830994a30ca20961f8f [237/239] bcachefs: Kill bch2_bkey_get_iter_typed()
config: x86_64-buildonly-randconfig-004-20250801 (https://download.01.org/0day-ci/archive/20250801/202508010656.YhJRK3DX-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250801/202508010656.YhJRK3DX-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/202508010656.YhJRK3DX-lkp@intel.com/

All errors (new ones prefixed by >>):

>> fs/bcachefs/namei.c:763:3: error: cannot jump from this goto statement to its label
     763 |                 fsck_err_on(target->bi_flags & BCH_INODE_unlinked,
         |                 ^
   fs/bcachefs/error.h:143:2: note: expanded from macro 'fsck_err_on'
     143 |         __fsck_err_on(cond, c, FSCK_CAN_FIX|FSCK_CAN_IGNORE, _err_type, __VA_ARGS__)
         |         ^
   fs/bcachefs/error.h:130:20: note: expanded from macro '__fsck_err_on'
     130 |         (unlikely(cond) ? __fsck_err(c, _flags, _err_type, __VA_ARGS__) : false);\
         |                           ^
   fs/bcachefs/error.h:117:26: note: expanded from macro '__fsck_err'
     117 | #define __fsck_err(...)         fsck_err_wrap(bch2_fsck_err(__VA_ARGS__))
         |                                 ^
   fs/bcachefs/error.h:111:3: note: expanded from macro 'fsck_err_wrap'
     111 |                 goto fsck_err;                                          \
         |                 ^
   fs/bcachefs/namei.c:778:20: note: jump bypasses initialization of variable with __attribute__((cleanup))
     778 |         CLASS(btree_iter, bp_iter)(trans, BTREE_ID_dirents,
         |                           ^
   fs/bcachefs/namei.c:754:3: error: cannot jump from this goto statement to its label
     754 |                 fsck_err_on(S_ISDIR(target->bi_mode),
         |                 ^
   fs/bcachefs/error.h:143:2: note: expanded from macro 'fsck_err_on'
     143 |         __fsck_err_on(cond, c, FSCK_CAN_FIX|FSCK_CAN_IGNORE, _err_type, __VA_ARGS__)
         |         ^
   fs/bcachefs/error.h:130:20: note: expanded from macro '__fsck_err_on'
     130 |         (unlikely(cond) ? __fsck_err(c, _flags, _err_type, __VA_ARGS__) : false);\
         |                           ^
   fs/bcachefs/error.h:117:26: note: expanded from macro '__fsck_err'
     117 | #define __fsck_err(...)         fsck_err_wrap(bch2_fsck_err(__VA_ARGS__))
         |                                 ^
   fs/bcachefs/error.h:111:3: note: expanded from macro 'fsck_err_wrap'
     111 |                 goto fsck_err;                                          \
         |                 ^
   fs/bcachefs/namei.c:778:20: note: jump bypasses initialization of variable with __attribute__((cleanup))
     778 |         CLASS(btree_iter, bp_iter)(trans, BTREE_ID_dirents,
         |                           ^
   2 errors generated.
--
>> fs/bcachefs/fsck.c:2170:6: error: cannot jump from this goto statement to its label
    2170 |             fsck_err_on(!ret && !bch2_snapshot_is_ancestor(c, parent_snapshot, d.k->p.snapshot),
         |             ^
   fs/bcachefs/error.h:143:2: note: expanded from macro 'fsck_err_on'
     143 |         __fsck_err_on(cond, c, FSCK_CAN_FIX|FSCK_CAN_IGNORE, _err_type, __VA_ARGS__)
         |         ^
   fs/bcachefs/error.h:130:20: note: expanded from macro '__fsck_err_on'
     130 |         (unlikely(cond) ? __fsck_err(c, _flags, _err_type, __VA_ARGS__) : false);\
         |                           ^
   fs/bcachefs/error.h:117:26: note: expanded from macro '__fsck_err'
     117 | #define __fsck_err(...)         fsck_err_wrap(bch2_fsck_err(__VA_ARGS__))
         |                                 ^
   fs/bcachefs/error.h:111:3: note: expanded from macro 'fsck_err_wrap'
     111 |                 goto fsck_err;                                          \
         |                 ^
   fs/bcachefs/fsck.c:2188:20: note: jump bypasses initialization of variable with __attribute__((cleanup))
    2188 |         CLASS(btree_iter, subvol_iter)(trans, BTREE_ID_subvolumes, POS(0, target_subvol), 0);
         |                           ^
   fs/bcachefs/fsck.c:2166:6: error: cannot jump from this goto statement to its label
    2166 |         if (fsck_err_on(ret,
         |             ^
   fs/bcachefs/error.h:143:2: note: expanded from macro 'fsck_err_on'
     143 |         __fsck_err_on(cond, c, FSCK_CAN_FIX|FSCK_CAN_IGNORE, _err_type, __VA_ARGS__)
         |         ^
   fs/bcachefs/error.h:130:20: note: expanded from macro '__fsck_err_on'
     130 |         (unlikely(cond) ? __fsck_err(c, _flags, _err_type, __VA_ARGS__) : false);\
         |                           ^
   fs/bcachefs/error.h:117:26: note: expanded from macro '__fsck_err'
     117 | #define __fsck_err(...)         fsck_err_wrap(bch2_fsck_err(__VA_ARGS__))
         |                                 ^
   fs/bcachefs/error.h:111:3: note: expanded from macro 'fsck_err_wrap'
     111 |                 goto fsck_err;                                          \
         |                 ^
   fs/bcachefs/fsck.c:2188:20: note: jump bypasses initialization of variable with __attribute__((cleanup))
    2188 |         CLASS(btree_iter, subvol_iter)(trans, BTREE_ID_subvolumes, POS(0, target_subvol), 0);
         |                           ^
   2 errors generated.


vim +763 fs/bcachefs/namei.c

758ea4ff812b4df Kent Overstreet 2025-03-20  740  
758ea4ff812b4df Kent Overstreet 2025-03-20  741  static int bch2_check_dirent_inode_dirent(struct btree_trans *trans,
758ea4ff812b4df Kent Overstreet 2025-03-20  742  					  struct bkey_s_c_dirent d,
9b0d00a3693bbab Kent Overstreet 2025-03-20  743  					  struct bch_inode_unpacked *target,
9b0d00a3693bbab Kent Overstreet 2025-03-20  744  					  bool in_fsck)
758ea4ff812b4df Kent Overstreet 2025-03-20  745  {
758ea4ff812b4df Kent Overstreet 2025-03-20  746  	struct bch_fs *c = trans->c;
600387c961b2ea6 Kent Overstreet 2025-07-14  747  	CLASS(printbuf, buf)();
758ea4ff812b4df Kent Overstreet 2025-03-20  748  	int ret = 0;
758ea4ff812b4df Kent Overstreet 2025-03-20  749  
758ea4ff812b4df Kent Overstreet 2025-03-20  750  	if (inode_points_to_dirent(target, d))
758ea4ff812b4df Kent Overstreet 2025-03-20  751  		return 0;
758ea4ff812b4df Kent Overstreet 2025-03-20  752  
bbc3a0b17a890aa Kent Overstreet 2025-06-17  753  	if (!bch2_inode_has_backpointer(target)) {
758ea4ff812b4df Kent Overstreet 2025-03-20  754  		fsck_err_on(S_ISDIR(target->bi_mode),
758ea4ff812b4df Kent Overstreet 2025-03-20  755  			    trans, inode_dir_missing_backpointer,
758ea4ff812b4df Kent Overstreet 2025-03-20  756  			    "directory with missing backpointer\n%s",
758ea4ff812b4df Kent Overstreet 2025-03-20  757  			    (printbuf_reset(&buf),
758ea4ff812b4df Kent Overstreet 2025-03-20  758  			     bch2_bkey_val_to_text(&buf, c, d.s_c),
758ea4ff812b4df Kent Overstreet 2025-03-20  759  			     prt_printf(&buf, "\n"),
758ea4ff812b4df Kent Overstreet 2025-03-20  760  			     bch2_inode_unpacked_to_text(&buf, target),
758ea4ff812b4df Kent Overstreet 2025-03-20  761  			     buf.buf));
758ea4ff812b4df Kent Overstreet 2025-03-20  762  
758ea4ff812b4df Kent Overstreet 2025-03-20 @763  		fsck_err_on(target->bi_flags & BCH_INODE_unlinked,
758ea4ff812b4df Kent Overstreet 2025-03-20  764  			    trans, inode_unlinked_but_has_dirent,
758ea4ff812b4df Kent Overstreet 2025-03-20  765  			    "inode unlinked but has dirent\n%s",
758ea4ff812b4df Kent Overstreet 2025-03-20  766  			    (printbuf_reset(&buf),
758ea4ff812b4df Kent Overstreet 2025-03-20  767  			     bch2_bkey_val_to_text(&buf, c, d.s_c),
758ea4ff812b4df Kent Overstreet 2025-03-20  768  			     prt_printf(&buf, "\n"),
758ea4ff812b4df Kent Overstreet 2025-03-20  769  			     bch2_inode_unpacked_to_text(&buf, target),
758ea4ff812b4df Kent Overstreet 2025-03-20  770  			     buf.buf));
758ea4ff812b4df Kent Overstreet 2025-03-20  771  
758ea4ff812b4df Kent Overstreet 2025-03-20  772  		target->bi_flags &= ~BCH_INODE_unlinked;
758ea4ff812b4df Kent Overstreet 2025-03-20  773  		target->bi_dir		= d.k->p.inode;
758ea4ff812b4df Kent Overstreet 2025-03-20  774  		target->bi_dir_offset	= d.k->p.offset;
758ea4ff812b4df Kent Overstreet 2025-03-20  775  		return __bch2_fsck_write_inode(trans, target);
758ea4ff812b4df Kent Overstreet 2025-03-20  776  	}
758ea4ff812b4df Kent Overstreet 2025-03-20  777  
0bb43b0a96be30c Kent Overstreet 2025-07-31  778  	CLASS(btree_iter, bp_iter)(trans, BTREE_ID_dirents,
0bb43b0a96be30c Kent Overstreet 2025-07-31  779  			      SPOS(target->bi_dir, target->bi_dir_offset, target->bi_snapshot), 0);
0bb43b0a96be30c Kent Overstreet 2025-07-31  780  	struct bkey_s_c_dirent bp_dirent = bch2_bkey_get_typed(&bp_iter, dirent);
758ea4ff812b4df Kent Overstreet 2025-03-20  781  	ret = bkey_err(bp_dirent);
758ea4ff812b4df Kent Overstreet 2025-03-20  782  	if (ret && !bch2_err_matches(ret, ENOENT))
758ea4ff812b4df Kent Overstreet 2025-03-20  783  		goto err;
758ea4ff812b4df Kent Overstreet 2025-03-20  784  
758ea4ff812b4df Kent Overstreet 2025-03-20  785  	bool backpointer_exists = !ret;
758ea4ff812b4df Kent Overstreet 2025-03-20  786  	ret = 0;
758ea4ff812b4df Kent Overstreet 2025-03-20  787  
9b0d00a3693bbab Kent Overstreet 2025-03-20  788  	if (!backpointer_exists) {
9b0d00a3693bbab Kent Overstreet 2025-03-20  789  		if (fsck_err(trans, inode_wrong_backpointer,
758ea4ff812b4df Kent Overstreet 2025-03-20  790  			     "inode %llu:%u has wrong backpointer:\n"
758ea4ff812b4df Kent Overstreet 2025-03-20  791  			     "got       %llu:%llu\n"
758ea4ff812b4df Kent Overstreet 2025-03-20  792  			     "should be %llu:%llu",
758ea4ff812b4df Kent Overstreet 2025-03-20  793  			     target->bi_inum, target->bi_snapshot,
758ea4ff812b4df Kent Overstreet 2025-03-20  794  			     target->bi_dir,
758ea4ff812b4df Kent Overstreet 2025-03-20  795  			     target->bi_dir_offset,
758ea4ff812b4df Kent Overstreet 2025-03-20  796  			     d.k->p.inode,
758ea4ff812b4df Kent Overstreet 2025-03-20  797  			     d.k->p.offset)) {
758ea4ff812b4df Kent Overstreet 2025-03-20  798  			target->bi_dir		= d.k->p.inode;
758ea4ff812b4df Kent Overstreet 2025-03-20  799  			target->bi_dir_offset	= d.k->p.offset;
758ea4ff812b4df Kent Overstreet 2025-03-20  800  			ret = __bch2_fsck_write_inode(trans, target);
758ea4ff812b4df Kent Overstreet 2025-03-20  801  		}
9b0d00a3693bbab Kent Overstreet 2025-03-20  802  	} else {
66621f016d79215 Kent Overstreet 2025-05-29  803  		printbuf_reset(&buf);
758ea4ff812b4df Kent Overstreet 2025-03-20  804  		bch2_bkey_val_to_text(&buf, c, d.s_c);
758ea4ff812b4df Kent Overstreet 2025-03-20  805  		prt_newline(&buf);
758ea4ff812b4df Kent Overstreet 2025-03-20  806  		bch2_bkey_val_to_text(&buf, c, bp_dirent.s_c);
758ea4ff812b4df Kent Overstreet 2025-03-20  807  
9b0d00a3693bbab Kent Overstreet 2025-03-20  808  		if (S_ISDIR(target->bi_mode) || target->bi_subvol) {
9b0d00a3693bbab Kent Overstreet 2025-03-20  809  			/*
9b0d00a3693bbab Kent Overstreet 2025-03-20  810  			 * XXX: verify connectivity of the other dirent
9b0d00a3693bbab Kent Overstreet 2025-03-20  811  			 * up to the root before removing this one
9b0d00a3693bbab Kent Overstreet 2025-03-20  812  			 *
9b0d00a3693bbab Kent Overstreet 2025-03-20  813  			 * Additionally, bch2_lookup would need to cope with the
9b0d00a3693bbab Kent Overstreet 2025-03-20  814  			 * dirent it found being removed - or should we remove
9b0d00a3693bbab Kent Overstreet 2025-03-20  815  			 * the other one, even though the inode points to it?
9b0d00a3693bbab Kent Overstreet 2025-03-20  816  			 */
9b0d00a3693bbab Kent Overstreet 2025-03-20  817  			if (in_fsck) {
9b0d00a3693bbab Kent Overstreet 2025-03-20  818  				if (fsck_err(trans, inode_dir_multiple_links,
758ea4ff812b4df Kent Overstreet 2025-03-20  819  					     "%s %llu:%u with multiple links\n%s",
758ea4ff812b4df Kent Overstreet 2025-03-20  820  					     S_ISDIR(target->bi_mode) ? "directory" : "subvolume",
9b0d00a3693bbab Kent Overstreet 2025-03-20  821  					     target->bi_inum, target->bi_snapshot, buf.buf))
758ea4ff812b4df Kent Overstreet 2025-03-20  822  					ret = bch2_fsck_remove_dirent(trans, d.k->p);
9b0d00a3693bbab Kent Overstreet 2025-03-20  823  			} else {
9b0d00a3693bbab Kent Overstreet 2025-03-20  824  				bch2_fs_inconsistent(c,
9b0d00a3693bbab Kent Overstreet 2025-03-20  825  						"%s %llu:%u with multiple links\n%s",
9b0d00a3693bbab Kent Overstreet 2025-03-20  826  						S_ISDIR(target->bi_mode) ? "directory" : "subvolume",
9b0d00a3693bbab Kent Overstreet 2025-03-20  827  						target->bi_inum, target->bi_snapshot, buf.buf);
758ea4ff812b4df Kent Overstreet 2025-03-20  828  			}
9b0d00a3693bbab Kent Overstreet 2025-03-20  829  		} else {
758ea4ff812b4df Kent Overstreet 2025-03-20  830  			/*
758ea4ff812b4df Kent Overstreet 2025-03-20  831  			 * hardlinked file with nlink 0:
758ea4ff812b4df Kent Overstreet 2025-03-20  832  			 * We're just adjusting nlink here so check_nlinks() will pick
758ea4ff812b4df Kent Overstreet 2025-03-20  833  			 * it up, it ignores inodes with nlink 0
758ea4ff812b4df Kent Overstreet 2025-03-20  834  			 */
9b0d00a3693bbab Kent Overstreet 2025-03-20  835  			if (fsck_err_on(!target->bi_nlink,
758ea4ff812b4df Kent Overstreet 2025-03-20  836  					trans, inode_multiple_links_but_nlink_0,
758ea4ff812b4df Kent Overstreet 2025-03-20  837  					"inode %llu:%u type %s has multiple links but i_nlink 0\n%s",
758ea4ff812b4df Kent Overstreet 2025-03-20  838  					target->bi_inum, target->bi_snapshot, bch2_d_types[d.v->d_type], buf.buf)) {
758ea4ff812b4df Kent Overstreet 2025-03-20  839  				target->bi_nlink++;
758ea4ff812b4df Kent Overstreet 2025-03-20  840  				target->bi_flags &= ~BCH_INODE_unlinked;
758ea4ff812b4df Kent Overstreet 2025-03-20  841  				ret = __bch2_fsck_write_inode(trans, target);
758ea4ff812b4df Kent Overstreet 2025-03-20  842  			}
9b0d00a3693bbab Kent Overstreet 2025-03-20  843  		}
9b0d00a3693bbab Kent Overstreet 2025-03-20  844  	}
758ea4ff812b4df Kent Overstreet 2025-03-20  845  err:
758ea4ff812b4df Kent Overstreet 2025-03-20  846  fsck_err:
758ea4ff812b4df Kent Overstreet 2025-03-20  847  	bch_err_fn(c, ret);
758ea4ff812b4df Kent Overstreet 2025-03-20  848  	return ret;
758ea4ff812b4df Kent Overstreet 2025-03-20  849  }
758ea4ff812b4df Kent Overstreet 2025-03-20  850  

:::::: The code at line 763 was first introduced by commit
:::::: 758ea4ff812b4dfd4cef6dba0eb4b0025a7b147e bcachefs: Move bch2_check_dirent_target() to namei.c

:::::: TO: Kent Overstreet <kent.overstreet@linux.dev>
:::::: CC: Kent Overstreet <kent.overstreet@linux.dev>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-07-31 23:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-31 23:01 [koverstreet-bcachefs:bcachefs-testing 237/239] fs/bcachefs/namei.c:763:3: error: cannot jump from this goto statement to its label kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).