summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-03-25 13:37:01 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-03-25 17:08:23 -0700
commit4a6e5b0e7d22d21caf2a9069f48dd5a53f833a32 (patch)
tree8657c53905aa1cca1f8105f153c3e0846da5fdc8
parent20e5a86008fb2400588fc5f9e0f00c07c1f13d99 (diff)
xfs: force inode inactivation and retry fs writes when there isn't space
Any time we try to modify a file's contents and it fails due to ENOSPC or EDQUOT, force inode inactivation work to try to free space. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
-rw-r--r--fs/xfs/xfs_icache.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 2dd02b8254fb..e5a1cc598684 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -1697,9 +1697,15 @@ xfs_blockgc_free_space(
struct xfs_mount *mp,
struct xfs_eofblocks *eofb)
{
+ int error;
+
trace_xfs_blockgc_free_space(mp, eofb, _RET_IP_);
- return xfs_inode_walk(mp, XFS_ICI_BLOCKGC_TAG, eofb);
+ error = xfs_inode_walk(mp, XFS_ICI_BLOCKGC_TAG, eofb);
+ if (error)
+ return error;
+
+ return xfs_inodegc_free_space(mp, eofb);
}
/*