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

From: Zhang Cen

Date: Thu May 28 2026 - 01:34:45 EST


Hi Christoph,

Sorry, I missed this reply earlier and only noticed it now from the
public archive.

> How did you run into this? Normal xfstests under a new sanitizer?

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.

> This looks good.

Thanks.

> This is later in the teardown order than where I'd expect it. The
> first thing that can bring in quotainodes is xfs_qm_newmount. I'd
> expect a new label placed above out_rtunmount to handle this. Is
> there a reason I'm missing why this won't work?

No, I don't think you are missing anything. A separate label above
out_rtunmount is the cleaner place for this. I'll send a v2 that keeps
the out_agresv inodegc drain before xfs_qm_unmount_quotas(), adds an
out_qm_unmount label above out_rtunmount, and routes the later
post-quota failure paths through that label.

I'll also fix the trailer spacing in v2.

Thanks,
Zhang