CC: kbuild-...@lists.01.org
CC: "Darrick J. Wong" <darrick.w...@oracle.com>
TO: Dave Chinner <dchin...@redhat.com>
CC: "Darrick J. Wong" <djw...@kernel.org>
CC: Brian Foster <bfos...@redhat.com>
CC: Allison Henderson <allison.hender...@oracle.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git 
xfs-merge-5.14
head:   fb08ae552954e7b1cf5cb8973f5576667663c3a6
commit: 742140d2a486832d3414b97e4b6e0eb6d8633a4c [21/23] xfs: xfs_log_force_lsn 
isn't passed a LSN
:::::: branch date: 5 days ago
:::::: commit date: 5 days ago
config: x86_64-randconfig-m001-20210622 (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 <l...@intel.com>
Reported-by: Dan Carpenter <dan.carpen...@oracle.com>

New smatch warnings:
fs/xfs/xfs_log.c:3313 xlog_force_lsn() warn: inconsistent returns 
'&log->l_icloglock'.

Old smatch warnings:
fs/xfs/xfs_log.c:1822 xlog_write_iclog() warn: inconsistent returns 
'&iclog->ic_sema'.
fs/xfs/xfs_log.c:3251 xfs_log_force() warn: inconsistent returns 
'&log->l_icloglock'.

vim +3313 fs/xfs/xfs_log.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  3253  
3e4da466bfa1de Christoph Hellwig 2018-03-13  3254  static int
742140d2a48683 Dave Chinner      2021-06-18  3255  xlog_force_lsn(
742140d2a48683 Dave Chinner      2021-06-18  3256       struct xlog             
*log,
^1da177e4c3f41 Linus Torvalds    2005-04-16  3257       xfs_lsn_t               
lsn,
f538d4da8d5217 Christoph Hellwig 2005-11-02  3258       uint                    
flags,
3e4da466bfa1de Christoph Hellwig 2018-03-13  3259       int                     
*log_flushed,
3e4da466bfa1de Christoph Hellwig 2018-03-13  3260       bool                    
already_slept)
^1da177e4c3f41 Linus Torvalds    2005-04-16  3261  {
a14a348bff2f99 Christoph Hellwig 2010-01-19  3262       struct xlog_in_core     
*iclog;
71e330b593905e Dave Chinner      2010-05-21  3263  
b22cd72c95df04 Eric Sandeen      2007-10-11  3264       
spin_lock(&log->l_icloglock);
^1da177e4c3f41 Linus Torvalds    2005-04-16  3265       iclog = log->l_iclog;
1858bb0bec612d Christoph Hellwig 2019-10-14  3266       if (iclog->ic_state == 
XLOG_STATE_IOERROR)
93806299b56b22 Christoph Hellwig 2018-03-13  3267               goto out_error;
^1da177e4c3f41 Linus Torvalds    2005-04-16  3268  
93806299b56b22 Christoph Hellwig 2018-03-13  3269       while 
(be64_to_cpu(iclog->ic_header.h_lsn) != lsn) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  3270               iclog = 
iclog->ic_next;
93806299b56b22 Christoph Hellwig 2018-03-13  3271               if (iclog == 
log->l_iclog)
93806299b56b22 Christoph Hellwig 2018-03-13  3272                       goto 
out_unlock;
^1da177e4c3f41 Linus Torvalds    2005-04-16  3273       }
^1da177e4c3f41 Linus Torvalds    2005-04-16  3274  
^1da177e4c3f41 Linus Torvalds    2005-04-16  3275       if (iclog->ic_state == 
XLOG_STATE_ACTIVE) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  3276               /*
93806299b56b22 Christoph Hellwig 2018-03-13  3277                * We sleep 
here if we haven't already slept (e.g. this is the
93806299b56b22 Christoph Hellwig 2018-03-13  3278                * first time 
we've looked at the correct iclog buf) and the
93806299b56b22 Christoph Hellwig 2018-03-13  3279                * buffer 
before us is going to be sync'ed.  The reason for this
93806299b56b22 Christoph Hellwig 2018-03-13  3280                * is that if 
we are doing sync transactions here, by waiting
93806299b56b22 Christoph Hellwig 2018-03-13  3281                * for the 
previous I/O to complete, we can allow a few more
93806299b56b22 Christoph Hellwig 2018-03-13  3282                * transactions 
into this iclog before we close it down.
^1da177e4c3f41 Linus Torvalds    2005-04-16  3283                *
93806299b56b22 Christoph Hellwig 2018-03-13  3284                * Otherwise, 
we mark the buffer WANT_SYNC, and bump up the
93806299b56b22 Christoph Hellwig 2018-03-13  3285                * refcnt so we 
can release the log (which drops the ref count).
93806299b56b22 Christoph Hellwig 2018-03-13  3286                * The state 
switch keeps new transaction commits from using
93806299b56b22 Christoph Hellwig 2018-03-13  3287                * this buffer. 
 When the current commits finish writing into
93806299b56b22 Christoph Hellwig 2018-03-13  3288                * the buffer, 
the refcount will drop to zero and the buffer
93806299b56b22 Christoph Hellwig 2018-03-13  3289                * will go out 
then.
^1da177e4c3f41 Linus Torvalds    2005-04-16  3290                */
^1da177e4c3f41 Linus Torvalds    2005-04-16  3291               if 
(!already_slept &&
1858bb0bec612d Christoph Hellwig 2019-10-14  3292                   
(iclog->ic_prev->ic_state == XLOG_STATE_WANT_SYNC ||
1858bb0bec612d Christoph Hellwig 2019-10-14  3293                    
iclog->ic_prev->ic_state == XLOG_STATE_SYNCING)) {
eb40a87500ac2f Dave Chinner      2010-12-21  3294                       
xlog_wait(&iclog->ic_prev->ic_write_wait,
eb40a87500ac2f Dave Chinner      2010-12-21  3295                               
        &log->l_icloglock);
3e4da466bfa1de Christoph Hellwig 2018-03-13  3296                       return 
-EAGAIN;
a14a348bff2f99 Christoph Hellwig 2010-01-19  3297               }
155cc6b784a959 David Chinner     2008-03-06  3298               
atomic_inc(&iclog->ic_refcnt);
^1da177e4c3f41 Linus Torvalds    2005-04-16  3299               
xlog_state_switch_iclogs(log, iclog, 0);
^1da177e4c3f41 Linus Torvalds    2005-04-16  3300               if 
(xlog_state_release_iclog(log, iclog))
df732b29c80764 Christoph Hellwig 2019-10-14  3301                       goto 
out_error;
a14a348bff2f99 Christoph Hellwig 2010-01-19  3302               if (log_flushed)
f538d4da8d5217 Christoph Hellwig 2005-11-02  3303                       
*log_flushed = 1;
^1da177e4c3f41 Linus Torvalds    2005-04-16  3304       }
^1da177e4c3f41 Linus Torvalds    2005-04-16  3305  
81e5b50a8fb5a2 Christoph Hellwig 2020-03-20  3306       if (flags & 
XFS_LOG_SYNC)
81e5b50a8fb5a2 Christoph Hellwig 2020-03-20  3307               return 
xlog_wait_on_iclog(iclog);
93806299b56b22 Christoph Hellwig 2018-03-13  3308  out_unlock:
b22cd72c95df04 Eric Sandeen      2007-10-11  3309       
spin_unlock(&log->l_icloglock);
014c2544e6fd09 Jesper Juhl       2006-01-15  3310       return 0;
93806299b56b22 Christoph Hellwig 2018-03-13  3311  out_error:
93806299b56b22 Christoph Hellwig 2018-03-13  3312       
spin_unlock(&log->l_icloglock);
93806299b56b22 Christoph Hellwig 2018-03-13 @3313       return -EIO;
a14a348bff2f99 Christoph Hellwig 2010-01-19  3314  }
a14a348bff2f99 Christoph Hellwig 2010-01-19  3315  

:::::: The code at line 3313 was first introduced by commit
:::::: 93806299b56b22df8fec9b78cb4c9c41d283ee2a xfs: refactor xfs_log_force_lsn

:::::: TO: Christoph Hellwig <h...@lst.de>
:::::: CC: Darrick J. Wong <darrick.w...@oracle.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lists.01.org

Reply via email to