tree:
https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git
for-next.radical6j
head: 7b8c8263459404aea0c41574ef44e827d7ea1215
commit: e1112869d94825c3692450ed0508f349fadb9f36 [23/26] gfs2: Call state machine on
non-delayed dequeue
config: x86_64-randconfig-s022-20210311 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-262-g5e674421-dirty
#
https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git/commi...
git remote add gfs2
https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git
git fetch --no-tags gfs2 for-next.radical6j
git checkout e1112869d94825c3692450ed0508f349fadb9f36
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
fs/gfs2/glock.c: note: in included file:
fs/gfs2/glock.h:222:36: sparse: sparse: context imbalance in '__gfs2_glock_put'
- unexpected unlock
fs/gfs2/glock.c:973:9: sparse: sparse: context imbalance in 'state_machine' -
wrong count at exit
> fs/gfs2/glock.c:1627:6: sparse: sparse: context imbalance in
'gfs2_glock_dq' - wrong count at exit
fs/gfs2/glock.c:1963:26: sparse:
sparse: context imbalance in 'gfs2_dispose_glock_lru' - different lock contexts
for basic block
fs/gfs2/glock.c:2151:9: sparse: sparse: context imbalance in 'clear_glock' -
wrong count at exit
vim +/gfs2_glock_dq +1627 fs/gfs2/glock.c
b3b94faa5fe596 David Teigland 2006-01-16 1620
b3b94faa5fe596 David Teigland 2006-01-16 1621 /**
b3b94faa5fe596 David Teigland 2006-01-16 1622 * gfs2_glock_dq - dequeue a struct
gfs2_holder from a glock (release a glock)
b3b94faa5fe596 David Teigland 2006-01-16 1623 * @gh: the glock holder
b3b94faa5fe596 David Teigland 2006-01-16 1624 *
b3b94faa5fe596 David Teigland 2006-01-16 1625 */
b3b94faa5fe596 David Teigland 2006-01-16 1626
b3b94faa5fe596 David Teigland 2006-01-16 @1627 void gfs2_glock_dq(struct gfs2_holder
*gh)
b3b94faa5fe596 David Teigland 2006-01-16 1628 {
b3b94faa5fe596 David Teigland 2006-01-16 1629 struct gfs2_glock *gl =
gh->gh_gl;
601ef0d52e9617 Bob Peterson 2020-01-28 1630 struct gfs2_sbd *sdp =
gl->gl_name.ln_sbd;
c4f68a130fc179 Benjamin Marzinski 2007-08-23 1631 unsigned delay = 0;
6802e3400ff454 Steven Whitehouse 2008-05-21 1632 int fast_path = 0;
b3b94faa5fe596 David Teigland 2006-01-16 1633
f3dd1649122b9e Andreas Gruenbacher 2015-10-29 1634
spin_lock(&gl->gl_lockref.lock);
601ef0d52e9617 Bob Peterson 2020-01-28 1635 /*
601ef0d52e9617 Bob Peterson 2020-01-28 1636 * If we're in the process of
file system withdraw, we cannot just
601ef0d52e9617 Bob Peterson 2020-01-28 1637 * dequeue any glocks until our
journal is recovered, lest we
601ef0d52e9617 Bob Peterson 2020-01-28 1638 * introduce file system corruption.
We need two exceptions to this
601ef0d52e9617 Bob Peterson 2020-01-28 1639 * rule: We need to allow unlocking
of nondisk glocks and the glock
601ef0d52e9617 Bob Peterson 2020-01-28 1640 * for our own journal that needs
recovery.
601ef0d52e9617 Bob Peterson 2020-01-28 1641 */
601ef0d52e9617 Bob Peterson 2020-01-28 1642 if (test_bit(SDF_WITHDRAW_RECOVERY,
&sdp->sd_flags) &&
601ef0d52e9617 Bob Peterson 2020-01-28 1643 glock_blocked_by_withdraw(gl)
&&
601ef0d52e9617 Bob Peterson 2020-01-28 1644 gh->gh_gl !=
sdp->sd_jinode_gl) {
601ef0d52e9617 Bob Peterson 2020-01-28 1645 sdp->sd_glock_dqs_held++;
601ef0d52e9617 Bob Peterson 2020-01-28 1646 might_sleep();
601ef0d52e9617 Bob Peterson 2020-01-28 1647 wait_on_bit(&sdp->sd_flags,
SDF_WITHDRAW_RECOVERY,
601ef0d52e9617 Bob Peterson 2020-01-28 1648 TASK_UNINTERRUPTIBLE);
601ef0d52e9617 Bob Peterson 2020-01-28 1649 }
b3b94faa5fe596 David Teigland 2006-01-16 1650 if (gh->gh_flags &
GL_NOCACHE)
4897a284e835c9 Bob Peterson 2021-03-09 1651 request_unlock(gl);
b3b94faa5fe596 David Teigland 2006-01-16 1652
b3b94faa5fe596 David Teigland 2006-01-16 1653 list_del_init(&gh->gh_list);
7508abc4bdac43 Bob Peterson 2015-12-18 1654 clear_bit(HIF_HOLDER,
&gh->gh_iflags);
6802e3400ff454 Steven Whitehouse 2008-05-21 1655 if (find_first_holder(gl) == NULL)
{
6802e3400ff454 Steven Whitehouse 2008-05-21 1656 if
(list_empty(&gl->gl_holders) &&
6802e3400ff454 Steven Whitehouse 2008-05-21 1657 !test_bit(GLF_PENDING_DEMOTE,
&gl->gl_flags) &&
6802e3400ff454 Steven Whitehouse 2008-05-21 1658 !test_bit(GLF_DEMOTE,
&gl->gl_flags))
6802e3400ff454 Steven Whitehouse 2008-05-21 1659 fast_path = 1;
b3b94faa5fe596 David Teigland 2006-01-16 1660 }
7881ef3f33bb80 Ross Lagerwall 2019-03-27 1661 if (!test_bit(GLF_LFLUSH,
&gl->gl_flags) && demote_ok(gl))
4abb6ad9eae0ae Bob Peterson 2012-08-09 1662 gfs2_glock_add_to_lru(gl);
4abb6ad9eae0ae Bob Peterson 2012-08-09 1663
63997775b795f9 Steven Whitehouse 2009-06-12 1664 trace_gfs2_glock_queue(gh, 0);
6b0c7440bcb4b7 Andreas Gruenbacher 2017-06-30 1665 if (unlikely(!fast_path)) {
6b0c7440bcb4b7 Andreas Gruenbacher 2017-06-30 1666 gl->gl_lockref.count++;
c4f68a130fc179 Benjamin Marzinski 2007-08-23 1667 if (test_bit(GLF_PENDING_DEMOTE,
&gl->gl_flags) &&
7cf8dcd3b68a76 Bob Peterson 2011-06-15 1668 !test_bit(GLF_DEMOTE,
&gl->gl_flags) &&
7cf8dcd3b68a76 Bob Peterson 2011-06-15 1669 gl->gl_name.ln_type ==
LM_TYPE_INODE)
7cf8dcd3b68a76 Bob Peterson 2011-06-15 1670 delay = gl->gl_hold_time;
e1112869d94825 Bob Peterson 2021-03-09 1671 if (delay)
6b0c7440bcb4b7 Andreas Gruenbacher 2017-06-30 1672 __gfs2_glock_queue_work(gl,
delay);
e1112869d94825 Bob Peterson 2021-03-09 1673 else {
e1112869d94825 Bob Peterson 2021-03-09 1674 if (__state_machine(gl,
GL_ST_RUN_QUEUE))
e1112869d94825 Bob Peterson 2021-03-09 1675 return;
e1112869d94825 Bob Peterson 2021-03-09 1676 }
6b0c7440bcb4b7 Andreas Gruenbacher 2017-06-30 1677 }
6b0c7440bcb4b7 Andreas Gruenbacher 2017-06-30 1678
spin_unlock(&gl->gl_lockref.lock);
b3b94faa5fe596 David Teigland 2006-01-16 1679 }
b3b94faa5fe596 David Teigland 2006-01-16 1680
:::::: The code at line 1627 was first introduced by commit
:::::: b3b94faa5fe5968827ba0640ee9fba4b3e7f736e [GFS2] The core of GFS2
:::::: TO: David Teigland <teigland(a)redhat.com>
:::::: CC: Steven Whitehouse <swhiteho(a)redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org