Commit 647b3d59 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Carlos Maiolino
Browse files

xfs: fix frozen file system assert in xfs_trans_alloc



Commit 83a80e95 ("xfs: decouple xfs_trans_alloc_empty from
xfs_trans_alloc") move the place of the assert for a frozen file system
after the sb_start_intwrite call that ensures it doesn't run on frozen
file systems, and thus allows to incorrect trigger it.

Fix that by moving it back to where it belongs.

Fixes: 83a80e95 ("xfs: decouple xfs_trans_alloc_empty from xfs_trans_alloc")
Reported-by: default avatarDave Chinner <david@fromorbit.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent 8f5ae30d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -253,8 +253,8 @@ xfs_trans_alloc(
	 * by doing GFP_KERNEL allocations inside sb_start_intwrite().
	 */
retry:
	WARN_ON(mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE);
	tp = __xfs_trans_alloc(mp, flags);
	WARN_ON(mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE);
	error = xfs_trans_reserve(tp, resp, blocks, rtextents);
	if (error == -ENOSPC && want_retry) {
		xfs_trans_cancel(tp);