Re: [PATCH 06/11] xfs: flush eof/cowblocks if we can't reserve quota for file blocks

Christoph Hellwig
2021-01-24T09:40:46Z

> + /* We only allow one retry for EDQUOT/ENOSPC. */
> + if (*retry || (error != -EDQUOT && error != -ENOSPC)) {
> + *retry = false;
> + return error;
> + }

> + /* Release resources, prepare for scan. */
> + xfs_trans_cancel(*tpp);
> + *tpp = NULL;
> + xfs_iunlock(ip, XFS_ILOCK_EXCL);
> +
> + /* Try to free some quota for this file's dquots. */
> + *retry = true;
> + xfs_blockgc_free_quota(ip, 0);
> + return 0;

I till have grave reservations about this calling conventions. And if
you just remove the unlock and th call to xfs_blockgc_free_quota here
we don't equire a whole lot of boilerplate code in the callers while
making the code possible to reason about for a mere human.