CC: [email protected]
CC: "Darrick J. Wong" <[email protected]>
TO: "Darrick J. Wong" <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git 
vectorized-scrub
head:   b622080f7532c7c6bcec0f0f3166928813844885
commit: b507df384a174caa67d4c55de60b3bc7328b1710 [142/327] xfs: add a 
->xchg_file_range handler
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago
config: i386-randconfig-m021-20210504 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
fs/xfs/xfs_xchgrange.c:240 xfs_xchg_range_grab_log_assist() warn: missing error 
code 'error'

vim +/error +240 fs/xfs/xfs_xchgrange.c

b507df384a174c Darrick J. Wong 2021-01-05  204  
b507df384a174c Darrick J. Wong 2021-01-05  205  /*
b507df384a174c Darrick J. Wong 2021-01-05  206   * Get permission to use 
log-assisted atomic exchange of file extents.
b507df384a174c Darrick J. Wong 2021-01-05  207   *
b507df384a174c Darrick J. Wong 2021-01-05  208   * Callers must not be running 
any transactions or hold any inode locks, and
b507df384a174c Darrick J. Wong 2021-01-05  209   * they must release the 
permission by calling xfs_xchg_range_rele_log_assist
b507df384a174c Darrick J. Wong 2021-01-05  210   * when they're done.
b507df384a174c Darrick J. Wong 2021-01-05  211   */
b507df384a174c Darrick J. Wong 2021-01-05  212  int
b507df384a174c Darrick J. Wong 2021-01-05  213  xfs_xchg_range_grab_log_assist(
b507df384a174c Darrick J. Wong 2021-01-05  214          struct xfs_mount        
*mp,
b507df384a174c Darrick J. Wong 2021-01-05  215          bool                    
force,
b507df384a174c Darrick J. Wong 2021-01-05  216          bool                    
*enabled)
b507df384a174c Darrick J. Wong 2021-01-05  217  {
b507df384a174c Darrick J. Wong 2021-01-05  218          int                     
error = 0;
b507df384a174c Darrick J. Wong 2021-01-05  219  
b507df384a174c Darrick J. Wong 2021-01-05  220          /*
b507df384a174c Darrick J. Wong 2021-01-05  221           * Protect ourselves 
from an idle log clearing the atomic swapext
b507df384a174c Darrick J. Wong 2021-01-05  222           * log incompat feature 
bit.
b507df384a174c Darrick J. Wong 2021-01-05  223           */
b507df384a174c Darrick J. Wong 2021-01-05  224          
xlog_use_incompat_feat(mp->m_log);
b507df384a174c Darrick J. Wong 2021-01-05  225          *enabled = true;
b507df384a174c Darrick J. Wong 2021-01-05  226  
b507df384a174c Darrick J. Wong 2021-01-05  227          /*
b507df384a174c Darrick J. Wong 2021-01-05  228           * If log-assisted 
swapping is already enabled, the caller can use the
b507df384a174c Darrick J. Wong 2021-01-05  229           * log assisted swap 
functions with the log-incompat reference we got.
b507df384a174c Darrick J. Wong 2021-01-05  230           */
b507df384a174c Darrick J. Wong 2021-01-05  231          if 
(xfs_sb_version_hasatomicswap(&mp->m_sb))
b507df384a174c Darrick J. Wong 2021-01-05  232                  return 0;
b507df384a174c Darrick J. Wong 2021-01-05  233  
b507df384a174c Darrick J. Wong 2021-01-05  234          /*
b507df384a174c Darrick J. Wong 2021-01-05  235           * If the caller 
doesn't /require/ log-assisted swapping, drop the
b507df384a174c Darrick J. Wong 2021-01-05  236           * log-incompat feature 
protection and exit.  The caller cannot use
b507df384a174c Darrick J. Wong 2021-01-05  237           * log assisted 
swapping.
b507df384a174c Darrick J. Wong 2021-01-05  238           */
b507df384a174c Darrick J. Wong 2021-01-05  239          if (!force)
b507df384a174c Darrick J. Wong 2021-01-05 @240                  goto err;
b507df384a174c Darrick J. Wong 2021-01-05  241  
b507df384a174c Darrick J. Wong 2021-01-05  242          /*
b507df384a174c Darrick J. Wong 2021-01-05  243           * Caller requires 
log-assisted swapping but the fs feature set isn't
b507df384a174c Darrick J. Wong 2021-01-05  244           * rich enough to 
support it.  Bail out.
b507df384a174c Darrick J. Wong 2021-01-05  245           */
b507df384a174c Darrick J. Wong 2021-01-05  246          if 
(!xfs_sb_version_canatomicswap(&mp->m_sb)) {
b507df384a174c Darrick J. Wong 2021-01-05  247                  error = 
-EOPNOTSUPP;
b507df384a174c Darrick J. Wong 2021-01-05  248                  goto err;
b507df384a174c Darrick J. Wong 2021-01-05  249          }
b507df384a174c Darrick J. Wong 2021-01-05  250  
b507df384a174c Darrick J. Wong 2021-01-05  251          /* Enable log-assisted 
extent swapping. */
b507df384a174c Darrick J. Wong 2021-01-05  252          xfs_warn(mp,
b507df384a174c Darrick J. Wong 2021-01-05  253   "EXPERIMENTAL atomic file 
range swap feature added. Use at your own risk!");
b507df384a174c Darrick J. Wong 2021-01-05  254          error = 
xfs_add_incompat_log_feature(mp,
b507df384a174c Darrick J. Wong 2021-01-05  255                          
XFS_SB_FEAT_INCOMPAT_LOG_ATOMIC_SWAP);
b507df384a174c Darrick J. Wong 2021-01-05  256          if (error)
b507df384a174c Darrick J. Wong 2021-01-05  257                  goto err;
b507df384a174c Darrick J. Wong 2021-01-05  258          return 0;
b507df384a174c Darrick J. Wong 2021-01-05  259  err:
b507df384a174c Darrick J. Wong 2021-01-05  260          
xlog_drop_incompat_feat(mp->m_log);
b507df384a174c Darrick J. Wong 2021-01-05  261          *enabled = false;
b507df384a174c Darrick J. Wong 2021-01-05  262          return error;
b507df384a174c Darrick J. Wong 2021-01-05  263  }
b507df384a174c Darrick J. Wong 2021-01-05  264  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to