]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: release dquot buffer after dqflush failure
authorYingjie Gao <gaoyingjie@uniontech.com>
Thu, 25 Jun 2026 13:16:23 +0000 (21:16 +0800)
committerCarlos Maiolino <cem@kernel.org>
Wed, 1 Jul 2026 09:35:50 +0000 (11:35 +0200)
commit0c1b3a823a22af623d55f225fe2ac7e8b9052821
treeda3de1f7a751dab2111cc3762b027131b4586ece
parent0b434b552ecd19f33e2f85ea8e55dbb65352810d
xfs: release dquot buffer after dqflush failure

xfs_qm_dqpurge() gets a locked buffer from xfs_dquot_use_attached_buf().
If xfs_qm_dqflush() fails, the error path skips xfs_buf_relse() and then
calls xfs_dquot_detach_buf(), which tries to lock the same buffer again.

Release the buffer after xfs_qm_dqflush() returns so the error path drops
the caller hold and unlocks the buffer before the dquot is detached,
matching the other dqflush callers.

Fixes: a40fe30868ba ("xfs: separate dquot buffer reads from xfs_dqflush")
Cc: stable@vger.kernel.org # v6.13+
Signed-off-by: Yingjie Gao <gaoyingjie@uniontech.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_qm.c