[RFC PATCH 07/11] xfs: retry trans reservation on ENOSPC in xfs_inactive()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux