llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [brauner-github:work.fd.prepare 42/43] fs/xfs/xfs_handle.c:277:3: error: cannot jump from this goto statement to its label
@ 2025-11-18 20:27 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-11-18 20:27 UTC (permalink / raw)
  To: Christian Brauner; +Cc: llvm, oe-kbuild-all, Christian Brauner

tree:   https://github.com/brauner/linux.git work.fd.prepare
head:   7eb06f9f7a76175a82d3c6b9d94219d7b64b6bce
commit: 82f312eed222c8b171f70ee2ee055071ba43a665 [42/43] fs: xfs
config: arm-randconfig-002-20251119 (https://download.01.org/0day-ci/archive/20251119/202511190447.ZpMsjLKJ-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251119/202511190447.ZpMsjLKJ-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/202511190447.ZpMsjLKJ-lkp@intel.com/

All errors (new ones prefixed by >>):

>> fs/xfs/xfs_handle.c:277:3: error: cannot jump from this goto statement to its label
                   goto out_dput;
                   ^
   fs/xfs/xfs_handle.c:283:13: note: jump bypasses initialization of variable with __attribute__((cleanup))
           FD_PREPARE(fdprep, 0, dentry_open(&path, hreq->oflags, cred));
                      ^
   fs/xfs/xfs_handle.c:271:3: error: cannot jump from this goto statement to its label
                   goto out_dput;
                   ^
   fs/xfs/xfs_handle.c:283:13: note: jump bypasses initialization of variable with __attribute__((cleanup))
           FD_PREPARE(fdprep, 0, dentry_open(&path, hreq->oflags, cred));
                      ^
   fs/xfs/xfs_handle.c:266:3: error: cannot jump from this goto statement to its label
                   goto out_dput;
                   ^
   fs/xfs/xfs_handle.c:283:13: note: jump bypasses initialization of variable with __attribute__((cleanup))
           FD_PREPARE(fdprep, 0, dentry_open(&path, hreq->oflags, cred));
                      ^
   fs/xfs/xfs_handle.c:254:3: error: cannot jump from this goto statement to its label
                   goto out_dput;
                   ^
   fs/xfs/xfs_handle.c:283:13: note: jump bypasses initialization of variable with __attribute__((cleanup))
           FD_PREPARE(fdprep, 0, dentry_open(&path, hreq->oflags, cred));
                      ^
   4 errors generated.


vim +277 fs/xfs/xfs_handle.c

af69d852dfe62b Darrick J. Wong   2024-04-22  260  
af69d852dfe62b Darrick J. Wong   2024-04-22  261  	permflag = hreq->oflags;
af69d852dfe62b Darrick J. Wong   2024-04-22  262  	fmode = OPEN_FMODE(permflag);
af69d852dfe62b Darrick J. Wong   2024-04-22  263  	if ((!(permflag & O_APPEND) || (permflag & O_TRUNC)) &&
af69d852dfe62b Darrick J. Wong   2024-04-22  264  	    (fmode & FMODE_WRITE) && IS_APPEND(inode)) {
af69d852dfe62b Darrick J. Wong   2024-04-22  265  		error = -EPERM;
af69d852dfe62b Darrick J. Wong   2024-04-22  266  		goto out_dput;
af69d852dfe62b Darrick J. Wong   2024-04-22  267  	}
af69d852dfe62b Darrick J. Wong   2024-04-22  268  
af69d852dfe62b Darrick J. Wong   2024-04-22  269  	if ((fmode & FMODE_WRITE) && IS_IMMUTABLE(inode)) {
af69d852dfe62b Darrick J. Wong   2024-04-22  270  		error = -EPERM;
af69d852dfe62b Darrick J. Wong   2024-04-22  271  		goto out_dput;
af69d852dfe62b Darrick J. Wong   2024-04-22  272  	}
af69d852dfe62b Darrick J. Wong   2024-04-22  273  
af69d852dfe62b Darrick J. Wong   2024-04-22  274  	/* Can't write directories. */
af69d852dfe62b Darrick J. Wong   2024-04-22  275  	if (S_ISDIR(inode->i_mode) && (fmode & FMODE_WRITE)) {
af69d852dfe62b Darrick J. Wong   2024-04-22  276  		error = -EISDIR;
af69d852dfe62b Darrick J. Wong   2024-04-22 @277  		goto out_dput;
af69d852dfe62b Darrick J. Wong   2024-04-22  278  	}
af69d852dfe62b Darrick J. Wong   2024-04-22  279  
af69d852dfe62b Darrick J. Wong   2024-04-22  280  	path.mnt = parfilp->f_path.mnt;
af69d852dfe62b Darrick J. Wong   2024-04-22  281  	path.dentry = dentry;
82f312eed222c8 Christian Brauner 2025-11-18  282  
82f312eed222c8 Christian Brauner 2025-11-18  283  	FD_PREPARE(fdprep, 0, dentry_open(&path, hreq->oflags, cred));
af69d852dfe62b Darrick J. Wong   2024-04-22  284  	dput(dentry);
82f312eed222c8 Christian Brauner 2025-11-18  285  	if (fd_prepare_failed(fdprep))
82f312eed222c8 Christian Brauner 2025-11-18  286  		return fd_prepare_error(fdprep);
af69d852dfe62b Darrick J. Wong   2024-04-22  287  
af69d852dfe62b Darrick J. Wong   2024-04-22  288  	if (S_ISREG(inode->i_mode)) {
82f312eed222c8 Christian Brauner 2025-11-18  289  		struct file *filp = fd_prepare_file(fdprep);
82f312eed222c8 Christian Brauner 2025-11-18  290  
af69d852dfe62b Darrick J. Wong   2024-04-22  291  		filp->f_flags |= O_NOATIME;
af69d852dfe62b Darrick J. Wong   2024-04-22  292  		filp->f_mode |= FMODE_NOCMTIME;
af69d852dfe62b Darrick J. Wong   2024-04-22  293  	}
af69d852dfe62b Darrick J. Wong   2024-04-22  294  
82f312eed222c8 Christian Brauner 2025-11-18  295  	return fd_publish(fdprep);
af69d852dfe62b Darrick J. Wong   2024-04-22  296  
af69d852dfe62b Darrick J. Wong   2024-04-22  297   out_dput:
af69d852dfe62b Darrick J. Wong   2024-04-22  298  	dput(dentry);
af69d852dfe62b Darrick J. Wong   2024-04-22  299  	return error;
af69d852dfe62b Darrick J. Wong   2024-04-22  300  }
af69d852dfe62b Darrick J. Wong   2024-04-22  301  

:::::: The code at line 277 was first introduced by commit
:::::: af69d852dfe62b925d0df401eafad40698c889c6 xfs: move handle ioctl code to xfs_handle.c

:::::: TO: Darrick J. Wong <djwong@kernel.org>
:::::: CC: Darrick J. Wong <djwong@kernel.org>

-- 
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-11-18 20:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-18 20:27 [brauner-github:work.fd.prepare 42/43] fs/xfs/xfs_handle.c:277: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).