tag name | reclaim-space-harder_2021-02-22 (6dee09e223bd2f1f437ee805bacdbe1dd186750d) |
tag date | 2021-02-22 18:58:27 -0800 |
tagged by | Darrick J. Wong <djwong@kernel.org> |
tagged object | commit 8988381c48... |
xfs: try harder to reclaim space when we run out
Historically, when users ran out of space or quota when trying to write
to the filesystem, XFS didn't try very hard to reclaim space that it
might have speculatively allocated for the purpose of speeding up
front-end filesystem operations (appending writes, cow staging). The
upcoming deferred inactivation series will greatly increase the amount
of allocated space that isn't actively being used to store user data.
Therefore, try to reduce the circumstances where we return EDQUOT or
ENOSPC to userspace by teaching the write paths to try to clear space
and retry the operation one time before giving up.
Previous iterations of this patchset made massive changes to the
codebase, but thanks to the transaction allocation helpers that Brian
pushed for (in the previous patchset) this is mostly no longer
necessary. :)
v2: clean up and rebase against 5.11.
v3: restructure the retry loops per dchinner suggestion
v4: simplify the calling convention of xfs_trans_reserve_quota_nblks
v5: constrain the open-coded 'goto retry' loops to the helpers created
in the previous patchset
v6: move "xfs: try worst case space reservation upfront in
xfs_reflink_remap_extent" to this series, open-code the qretry
helpers in the (now very few) places they are used
v7: rebase chown stuff to use new helpers introduced in quota cleanups
v8: reorganize conditionals, rebase chown stuff again