All of lore.kernel.org
 help / color / mirror / Atom feed
* fs/xfs/xfs_log_recover.c:173:5-23: opportunity for str_write_read(op == REQ_OP_WRITE)
@ 2024-11-28  8:32 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-11-28  8:32 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Christoph Hellwig <hch@lst.de>
CC: "Darrick J. Wong" <darrick.wong@oracle.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b86545e02e8c22fb89218f29d381fa8e8b91d815
commit: 6ad5b3255b9e3d6d94154738aacd5119bf9c8f6e xfs: use bios directly to read and write the log recovery buffers
date:   5 years ago
:::::: branch date: 10 hours ago
:::::: commit date: 5 years ago
config: x86_64-randconfig-104-20241115 (https://download.01.org/0day-ci/archive/20241128/202411281626.NpBKMKT8-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202411281626.NpBKMKT8-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/xfs/xfs_log_recover.c:173:5-23: opportunity for str_write_read(op == REQ_OP_WRITE)

vim +173 fs/xfs/xfs_log_recover.c

076e6acb8f0d95 Christoph Hellwig 2009-03-16  145  
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  146  static int
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  147  xlog_do_io(
9a8d2fdbb47aaa Mark Tinguely     2012-06-14  148  	struct xlog		*log,
^1da177e4c3f41 Linus Torvalds    2005-04-16  149  	xfs_daddr_t		blk_no,
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  150  	unsigned int		nbblks,
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  151  	char			*data,
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  152  	unsigned int		op)
^1da177e4c3f41 Linus Torvalds    2005-04-16  153  {
^1da177e4c3f41 Linus Torvalds    2005-04-16  154  	int			error;
^1da177e4c3f41 Linus Torvalds    2005-04-16  155  
99c265950b55f1 Brian Foster      2017-10-26  156  	if (!xlog_verify_bp(log, blk_no, nbblks)) {
99c265950b55f1 Brian Foster      2017-10-26  157  		xfs_warn(log->l_mp,
99c265950b55f1 Brian Foster      2017-10-26  158  			 "Invalid log block/length (0x%llx, 0x%x) for buffer",
99c265950b55f1 Brian Foster      2017-10-26  159  			 blk_no, nbblks);
ff30a6221d95b6 Alex Elder        2010-04-13  160  		XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_HIGH, log->l_mp);
2451337dd04390 Dave Chinner      2014-06-25  161  		return -EFSCORRUPTED;
3228149ceb8b04 Dave Chinner      2009-01-22  162  	}
3228149ceb8b04 Dave Chinner      2009-01-22  163  
69ce58f08a3c45 Alex Elder        2010-04-20  164  	blk_no = round_down(blk_no, log->l_sectBBsize);
69ce58f08a3c45 Alex Elder        2010-04-20  165  	nbblks = round_up(nbblks, log->l_sectBBsize);
^1da177e4c3f41 Linus Torvalds    2005-04-16  166  	ASSERT(nbblks > 0);
^1da177e4c3f41 Linus Torvalds    2005-04-16  167  
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  168  	error = xfs_rw_bdev(log->l_targ->bt_bdev, log->l_logBBstart + blk_no,
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  169  			BBTOB(nbblks), data, op);
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  170  	if (error && !XFS_FORCED_SHUTDOWN(log->l_mp)) {
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  171  		xfs_alert(log->l_mp,
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  172  			  "log recovery %s I/O error at daddr 0x%llx len %d error %d",
6ad5b3255b9e3d Christoph Hellwig 2019-06-28 @173  			  op == REQ_OP_WRITE ? "write" : "read",
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  174  			  blk_no, nbblks, error);
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  175  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  176  	return error;
^1da177e4c3f41 Linus Torvalds    2005-04-16  177  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  178  

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

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

* fs/xfs/xfs_log_recover.c:173:5-23: opportunity for str_write_read(op == REQ_OP_WRITE)
@ 2024-12-02 14:33 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-12-02 14:33 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Christoph Hellwig <hch@lst.de>
CC: "Darrick J. Wong" <darrick.wong@oracle.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e70140ba0d2b1a30467d4af6bcfe761327b9ec95
commit: 6ad5b3255b9e3d6d94154738aacd5119bf9c8f6e xfs: use bios directly to read and write the log recovery buffers
date:   5 years ago
:::::: branch date: 18 hours ago
:::::: commit date: 5 years ago
config: x86_64-randconfig-104-20241115 (https://download.01.org/0day-ci/archive/20241203/202412030002.mrwonn73-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202412030002.mrwonn73-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/xfs/xfs_log_recover.c:173:5-23: opportunity for str_write_read(op == REQ_OP_WRITE)

vim +173 fs/xfs/xfs_log_recover.c

076e6acb8f0d95 Christoph Hellwig 2009-03-16  145  
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  146  static int
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  147  xlog_do_io(
9a8d2fdbb47aaa Mark Tinguely     2012-06-14  148  	struct xlog		*log,
^1da177e4c3f41 Linus Torvalds    2005-04-16  149  	xfs_daddr_t		blk_no,
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  150  	unsigned int		nbblks,
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  151  	char			*data,
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  152  	unsigned int		op)
^1da177e4c3f41 Linus Torvalds    2005-04-16  153  {
^1da177e4c3f41 Linus Torvalds    2005-04-16  154  	int			error;
^1da177e4c3f41 Linus Torvalds    2005-04-16  155  
99c265950b55f1 Brian Foster      2017-10-26  156  	if (!xlog_verify_bp(log, blk_no, nbblks)) {
99c265950b55f1 Brian Foster      2017-10-26  157  		xfs_warn(log->l_mp,
99c265950b55f1 Brian Foster      2017-10-26  158  			 "Invalid log block/length (0x%llx, 0x%x) for buffer",
99c265950b55f1 Brian Foster      2017-10-26  159  			 blk_no, nbblks);
ff30a6221d95b6 Alex Elder        2010-04-13  160  		XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_HIGH, log->l_mp);
2451337dd04390 Dave Chinner      2014-06-25  161  		return -EFSCORRUPTED;
3228149ceb8b04 Dave Chinner      2009-01-22  162  	}
3228149ceb8b04 Dave Chinner      2009-01-22  163  
69ce58f08a3c45 Alex Elder        2010-04-20  164  	blk_no = round_down(blk_no, log->l_sectBBsize);
69ce58f08a3c45 Alex Elder        2010-04-20  165  	nbblks = round_up(nbblks, log->l_sectBBsize);
^1da177e4c3f41 Linus Torvalds    2005-04-16  166  	ASSERT(nbblks > 0);
^1da177e4c3f41 Linus Torvalds    2005-04-16  167  
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  168  	error = xfs_rw_bdev(log->l_targ->bt_bdev, log->l_logBBstart + blk_no,
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  169  			BBTOB(nbblks), data, op);
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  170  	if (error && !XFS_FORCED_SHUTDOWN(log->l_mp)) {
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  171  		xfs_alert(log->l_mp,
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  172  			  "log recovery %s I/O error at daddr 0x%llx len %d error %d",
6ad5b3255b9e3d Christoph Hellwig 2019-06-28 @173  			  op == REQ_OP_WRITE ? "write" : "read",
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  174  			  blk_no, nbblks, error);
6ad5b3255b9e3d Christoph Hellwig 2019-06-28  175  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  176  	return error;
^1da177e4c3f41 Linus Torvalds    2005-04-16  177  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  178  

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

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

end of thread, other threads:[~2024-12-02 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-02 14:33 fs/xfs/xfs_log_recover.c:173:5-23: opportunity for str_write_read(op == REQ_OP_WRITE) kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2024-11-28  8:32 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.