CC: [email protected]
TO: Josef Bacik <[email protected]>
CC: David Sterba <[email protected]>

tree:   https://github.com/kdave/btrfs-devel.git for-next-20200826
head:   703f7856a6d384e11ae6d73f62f25c974fde364f
commit: 1bcbe75fa3cd1e05f05518eccd1ee6432f653162 [67/82] btrfs: introduce 
path->recurse
:::::: branch date: 2 hours ago
:::::: commit date: 3 hours ago
config: i386-randconfig-s001-20200826 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-191-g10164920-dirty
        git checkout 1bcbe75fa3cd1e05f05518eccd1ee6432f653162
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


sparse warnings: (new ones prefixed by >>)

   fs/btrfs/locking.c:206:9: sparse: sparse: context imbalance in 
'btrfs_set_lock_blocking_read' - unexpected unlock
   fs/btrfs/locking.c:231:17: sparse: sparse: context imbalance in 
'btrfs_set_lock_blocking_write' - unexpected unlock
>> fs/btrfs/locking.c:247:6: sparse: sparse: context imbalance in 
>> '__btrfs_tree_read_lock' - different lock contexts for basic block
   fs/btrfs/locking.c:294:5: sparse: sparse: context imbalance in 
'btrfs_tree_read_lock_atomic' - different lock contexts for basic block
   fs/btrfs/locking.c:316:5: sparse: sparse: context imbalance in 
'btrfs_try_tree_read_lock' - different lock contexts for basic block
   fs/btrfs/locking.c:341:5: sparse: sparse: context imbalance in 
'btrfs_try_tree_write_lock' - different lock contexts for basic block
   fs/btrfs/locking.c:378:9: sparse: sparse: context imbalance in 
'btrfs_tree_read_unlock' - unexpected unlock
   fs/btrfs/locking.c:477:17: sparse: sparse: context imbalance in 
'btrfs_tree_unlock' - unexpected unlock
   fs/btrfs/locking.c:540:22: sparse: sparse: context imbalance in 
'btrfs_lock_root_node' - wrong count at exit

# 
https://github.com/kdave/btrfs-devel/commit/1bcbe75fa3cd1e05f05518eccd1ee6432f653162
git remote add kdave-btrfs-devel https://github.com/kdave/btrfs-devel.git
git fetch --no-tags kdave-btrfs-devel for-next-20200826
git checkout 1bcbe75fa3cd1e05f05518eccd1ee6432f653162
vim +/__btrfs_tree_read_lock +247 fs/btrfs/locking.c

b4ce94de9b4d64e Chris Mason  2009-02-04  237  
b4ce94de9b4d64e Chris Mason  2009-02-04  238  /*
d4e253bbbc20362 David Sterba 2019-10-16  239   * Lock the extent buffer for 
read. Wait for any writers (spinning or blocking).
d4e253bbbc20362 David Sterba 2019-10-16  240   * Can be nested in write lock by 
the same thread.
d4e253bbbc20362 David Sterba 2019-10-16  241   *
d4e253bbbc20362 David Sterba 2019-10-16  242   * Use when the locked section 
does only lightweight actions and busy waiting
d4e253bbbc20362 David Sterba 2019-10-16  243   * would be cheaper than making 
other threads do the wait/wake loop.
d4e253bbbc20362 David Sterba 2019-10-16  244   *
d4e253bbbc20362 David Sterba 2019-10-16  245   * The rwlock is held upon exit.
d352ac68148b699 Chris Mason  2008-09-29  246   */
1bcbe75fa3cd1e0 Josef Bacik  2020-08-20 @247  void 
__btrfs_tree_read_lock(struct extent_buffer *eb, bool recurse)
b4ce94de9b4d64e Chris Mason  2009-02-04  248  {
34e73cc930a8677 Qu Wenruo    2019-04-15  249    u64 start_ns = 0;
34e73cc930a8677 Qu Wenruo    2019-04-15  250  
34e73cc930a8677 Qu Wenruo    2019-04-15  251    if 
(trace_btrfs_tree_read_lock_enabled())
34e73cc930a8677 Qu Wenruo    2019-04-15  252            start_ns = 
ktime_get_ns();
bd681513fa6f2ff Chris Mason  2011-07-16  253  again:
5b25f70f4200766 Arne Jansen  2011-09-13  254    read_lock(&eb->lock);
06297d8cefcaa20 David Sterba 2019-05-02  255    BUG_ON(eb->blocking_writers == 
0 &&
06297d8cefcaa20 David Sterba 2019-05-02  256           current->pid == 
eb->lock_owner);
f5c2a52590858d1 David Sterba 2019-10-10  257    if (eb->blocking_writers) {
f5c2a52590858d1 David Sterba 2019-10-10  258            if (current->pid == 
eb->lock_owner) {
5b25f70f4200766 Arne Jansen  2011-09-13  259                    /*
f5c2a52590858d1 David Sterba 2019-10-10  260                     * This extent 
is already write-locked by our thread.
f5c2a52590858d1 David Sterba 2019-10-10  261                     * We allow an 
additional read lock to be added because
f5c2a52590858d1 David Sterba 2019-10-10  262                     * it's for the 
same thread. btrfs_find_all_roots()
f5c2a52590858d1 David Sterba 2019-10-10  263                     * depends on 
this as it may be called on a partly
f5c2a52590858d1 David Sterba 2019-10-10  264                     * 
(write-)locked tree.
5b25f70f4200766 Arne Jansen  2011-09-13  265                     */
1bcbe75fa3cd1e0 Josef Bacik  2020-08-20  266                    
WARN_ON(!recurse);
abb16a2357f2dc2 Josef Bacik  2020-08-20  267                    
BUG_ON(eb->lock_recursed);
abb16a2357f2dc2 Josef Bacik  2020-08-20  268                    
eb->lock_recursed = true;
5b25f70f4200766 Arne Jansen  2011-09-13  269                    
read_unlock(&eb->lock);
34e73cc930a8677 Qu Wenruo    2019-04-15  270                    
trace_btrfs_tree_read_lock(eb, start_ns);
5b25f70f4200766 Arne Jansen  2011-09-13  271                    return;
5b25f70f4200766 Arne Jansen  2011-09-13  272            }
bd681513fa6f2ff Chris Mason  2011-07-16  273            read_unlock(&eb->lock);
39f9d028c9906cc Liu Bo       2012-12-27  274            
wait_event(eb->write_lock_wq,
a4477988cfed18b David Sterba 2019-10-11  275                       
READ_ONCE(eb->blocking_writers) == 0);
bd681513fa6f2ff Chris Mason  2011-07-16  276            goto again;
b4ce94de9b4d64e Chris Mason  2009-02-04  277    }
5c9c799ab78336a David Sterba 2018-08-24  278    
btrfs_assert_tree_read_locks_get(eb);
afd495a8264fb25 David Sterba 2018-08-24  279    
btrfs_assert_spinning_readers_get(eb);
34e73cc930a8677 Qu Wenruo    2019-04-15  280    trace_btrfs_tree_read_lock(eb, 
start_ns);
b4ce94de9b4d64e Chris Mason  2009-02-04  281  }
d397712bcc6a759 Chris Mason  2009-01-05  282  

---
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