| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | [RFC PATCH 07/11] xfs: retry trans reservation on ENOSPC in xfs_inactive() |
| From: | Brian Foster <bfoster@xxxxxxxxxx> |
| Date: | Tue, 3 Sep 2013 14:25:04 -0400 |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <1378232708-57156-1-git-send-email-bfoster@xxxxxxxxxx> |
| References: | <1378232708-57156-1-git-send-email-bfoster@xxxxxxxxxx> |
An ifree data block reservation can fail with ENOSPC. Flush inodes
to try and free up space or attempt without a data block
reservation to avoid failing out of xfs_inactive().
Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>
---
fs/xfs/xfs_inode.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 56cbf63..92de4b7 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1779,7 +1779,18 @@ xfs_inactive(
tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE);
error = xfs_trans_reserve(tp, &M_RES(mp)->tr_ifree,
XFS_IFREE_SPACE_RES(mp), 0);
+ if (error == ENOSPC) {
+ /* flush outstanding delalloc blocks and retry */
+ xfs_flush_inodes(mp);
+ error = xfs_trans_reserve(tp, &M_RES(mp)->tr_ifree,
+ XFS_IFREE_SPACE_RES(mp), 0);
+ }
+ if (error == ENOSPC) {
+ /* resort to a no alloc. reservation */
+ error = xfs_trans_reserve(tp, &M_RES(mp)->tr_ifree, 0, 0);
+ }
if (error) {
+ ASSERT(XFS_FORCED_SHUTDOWN(mp));
xfs_trans_cancel(tp, 0);
goto out_unlock;
}
--
1.8.1.4
|
| Previous by Date: | [RFC PATCH 10/11] xfs: update the finobt on inode free, Brian Foster |
|---|---|
| Next by Date: | [RFC PATCH 05/11] xfs: update ifree transaction reservations for finobt, Brian Foster |
| Previous by Thread: | Better numbers Re: [RFC PATCH 10/11] xfs: update the finobt on inode free, Michael L. Semon |
| Next by Thread: | Re: [RFC PATCH 07/11] xfs: retry trans reservation on ENOSPC in xfs_inactive(), Dave Chinner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |