diff options
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index b9557795eb74..de32f0fe47c8 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -1792,22 +1792,23 @@ xfs_inactive_ifree( | |||
1792 | int error; | 1792 | int error; |
1793 | 1793 | ||
1794 | /* | 1794 | /* |
1795 | * The ifree transaction might need to allocate blocks for record | 1795 | * We try to use a per-AG reservation for any block needed by the finobt |
1796 | * insertion to the finobt. We don't want to fail here at ENOSPC, so | 1796 | * tree, but as the finobt feature predates the per-AG reservation |
1797 | * allow ifree to dip into the reserved block pool if necessary. | 1797 | * support a degraded file system might not have enough space for the |
1798 | * | 1798 | * reservation at mount time. In that case try to dip into the reserved |
1799 | * Freeing large sets of inodes generally means freeing inode chunks, | 1799 | * pool and pray. |
1800 | * directory and file data blocks, so this should be relatively safe. | ||
1801 | * Only under severe circumstances should it be possible to free enough | ||
1802 | * inodes to exhaust the reserve block pool via finobt expansion while | ||
1803 | * at the same time not creating free space in the filesystem. | ||
1804 | * | 1800 | * |
1805 | * Send a warning if the reservation does happen to fail, as the inode | 1801 | * Send a warning if the reservation does happen to fail, as the inode |
1806 | * now remains allocated and sits on the unlinked list until the fs is | 1802 | * now remains allocated and sits on the unlinked list until the fs is |
1807 | * repaired. | 1803 | * repaired. |
1808 | */ | 1804 | */ |
1809 | error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ifree, | 1805 | if (unlikely(mp->m_inotbt_nores)) { |
1810 | XFS_IFREE_SPACE_RES(mp), 0, XFS_TRANS_RESERVE, &tp); | 1806 | error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ifree, |
1807 | XFS_IFREE_SPACE_RES(mp), 0, XFS_TRANS_RESERVE, | ||
1808 | &tp); | ||
1809 | } else { | ||
1810 | error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ifree, 0, 0, 0, &tp); | ||
1811 | } | ||
1811 | if (error) { | 1812 | if (error) { |
1812 | if (error == -ENOSPC) { | 1813 | if (error == -ENOSPC) { |
1813 | xfs_warn_ratelimited(mp, | 1814 | xfs_warn_ratelimited(mp, |