diff options
| author | Darrick J. Wong <djwong@kernel.org> | 2025-02-07 11:28:38 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-02-17 10:05:45 +0100 |
| commit | ee6984a2279e1ce181a0f5525f10be7f060c3c75 (patch) | |
| tree | 222e7a3212682bf6f8cfd30e486f865ac1bb87cf /scripts/objdiff | |
| parent | d331fc154564548b605cde8427442b54c87d7fd3 (diff) | |
| download | linux-ee6984a2279e1ce181a0f5525f10be7f060c3c75.tar.gz linux-ee6984a2279e1ce181a0f5525f10be7f060c3c75.tar.bz2 linux-ee6984a2279e1ce181a0f5525f10be7f060c3c75.zip | |
xfs: release the dquot buf outside of qli_lock
commit 1aacd3fac248902ea1f7607f2d12b93929a4833b upstream
Lai Yi reported a lockdep complaint about circular locking:
Chain exists of:
&lp->qli_lock --> &bch->bc_lock --> &l->lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&l->lock);
lock(&bch->bc_lock);
lock(&l->lock);
lock(&lp->qli_lock);
I /think/ the problem here is that xfs_dquot_attach_buf during
quotacheck will release the buffer while it's holding the qli_lock.
Because this is a cached buffer, xfs_buf_rele_cached takes b_lock before
decrementing b_hold. Other threads have taught lockdep that a locking
dependency chain is bp->b_lock -> bch->bc_lock -> l(ru)->lock; and that
another chain is l(ru)->lock -> lp->qli_lock. Hence we do not want to
take b_lock while holding qli_lock.
Reported-by: syzbot+3126ab3db03db42e7a31@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org> # v6.13-rc3
Fixes: ca378189fdfa89 ("xfs: convert quotacheck to attach dquot buffers")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/objdiff')
0 files changed, 0 insertions, 0 deletions
