include/linux/rwlock_api_smp.h:219:9: sparse: sparse: context imbalance in '__jbd2_log_wait_for_space' - unexpected unlock

From: kernel test robot
Date: Thu Aug 20 2020 - 18:27:12 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7eac66d0456fe12a462e5c14c68e97c7460989da
commit: fbdc8f0f4891df7b5eb643ec0a509a4ac7dcfc2e parisc: Rework arch_rw locking functions
date: 5 months ago
config: parisc-randconfig-s032-20200820 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-191-g10164920-dirty
git checkout fbdc8f0f4891df7b5eb643ec0a509a4ac7dcfc2e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=parisc

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

fs/jbd2/checkpoint.c: note: in included file (through arch/parisc/include/uapi/asm/unistd.h, arch/parisc/include/asm/unistd.h, include/uapi/linux/unistd.h, ...):
./arch/parisc/include/generated/uapi/asm/unistd_32.h:382:41: sparse: sparse: no newline at end of file
fs/jbd2/checkpoint.c: note: in included file (through include/linux/spinlock_api_smp.h, include/linux/spinlock.h, include/linux/seqlock.h, ...):
>> include/linux/rwlock_api_smp.h:219:9: sparse: sparse: context imbalance in '__jbd2_log_wait_for_space' - unexpected unlock
--
fs/btrfs/ctree.c: note: in included file (through arch/parisc/include/uapi/asm/unistd.h, arch/parisc/include/asm/unistd.h, include/uapi/linux/unistd.h, ...):
./arch/parisc/include/generated/uapi/asm/unistd_32.h:382:41: sparse: sparse: no newline at end of file
fs/btrfs/ctree.c:129:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
fs/btrfs/ctree.c:129:22: sparse: struct extent_buffer [noderef] <asn:4> *
fs/btrfs/ctree.c:129:22: sparse: struct extent_buffer *
fs/btrfs/ctree.c:1085:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
fs/btrfs/ctree.c:1085:17: sparse: struct extent_buffer [noderef] <asn:4> *
fs/btrfs/ctree.c:1085:17: sparse: struct extent_buffer *
fs/btrfs/ctree.c:1859:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
fs/btrfs/ctree.c:1859:17: sparse: struct extent_buffer [noderef] <asn:4> *
fs/btrfs/ctree.c:1859:17: sparse: struct extent_buffer *
fs/btrfs/ctree.c:3351:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
fs/btrfs/ctree.c:3351:9: sparse: struct extent_buffer [noderef] <asn:4> *
fs/btrfs/ctree.c:3351:9: sparse: struct extent_buffer *
fs/btrfs/ctree.c: note: in included file (through include/linux/spinlock_api_smp.h, include/linux/spinlock.h, include/linux/wait.h, ...):
>> include/linux/rwlock_api_smp.h:219:9: sparse: sparse: context imbalance in 'tree_mod_log_insert_move' - unexpected unlock
include/linux/rwlock_api_smp.h:219:9: sparse: sparse: context imbalance in 'tree_mod_log_eb_copy' - unexpected unlock

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fbdc8f0f4891df7b5eb643ec0a509a4ac7dcfc2e
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout fbdc8f0f4891df7b5eb643ec0a509a4ac7dcfc2e
vim +/__jbd2_log_wait_for_space +219 include/linux/rwlock_api_smp.h

6b6b4792f89346e Thomas Gleixner 2009-11-16 215
9c1721aa4994f66 Thomas Gleixner 2009-12-03 216 static inline void __raw_write_unlock(rwlock_t *lock)
6b6b4792f89346e Thomas Gleixner 2009-11-16 217 {
5facae4f3549b5c Qian Cai 2019-09-19 218 rwlock_release(&lock->dep_map, _RET_IP_);
9828ea9d75c38fe Thomas Gleixner 2009-12-03 @219 do_raw_write_unlock(lock);
6b6b4792f89346e Thomas Gleixner 2009-11-16 220 preempt_enable();
6b6b4792f89346e Thomas Gleixner 2009-11-16 221 }
6b6b4792f89346e Thomas Gleixner 2009-11-16 222

:::::: The code at line 219 was first introduced by commit
:::::: 9828ea9d75c38fe3dce05d00566eed61c85732e6 locking: Further name space cleanups

:::::: TO: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
:::::: CC: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip