Re: [PATCH] xfs: drain inodegc before quota teardown on mount failure

From: Christoph Hellwig

Date: Thu May 28 2026 - 04:43:23 EST


On Thu, May 28, 2026 at 01:31:28PM +0800, Zhang Cen wrote:
> This was not from normal xfstests. I reproduced it in a KASAN-enabled
> QEMU guest with a disposable quota-enabled XFS image, then forced a late
> mount failure after quota setup while tracing the inodegc and quota
> teardown path. The failing ordering was:
>
> xfs_qm_mount_quotas()
> late mount failure
> xfs_qm_unmount_quotas()
> xfs_qm_unmount() / xfs_qm_destroy_quotainfo()
> xfs_inodegc_flush()
>
> with inodegc still able to reach the dqattach/dqget side during the
> teardown window.

Can you come up with an xfstest for this? I guess you'd need a new
error injection point, but that should not be horrible.