diff options
Diffstat (limited to 'fs/xfs/xfs_bmap_util.c')
-rw-r--r-- | fs/xfs/xfs_bmap_util.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index b8e2bff30704..8251ae1fe14e 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -946,7 +946,17 @@ xfs_alloc_file_space( retry: error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, resblks, resrtextents, 0, &tp); - + /* + * We weren't able to reserve enough space to handle fallocate. + * Flush any disk space that was being held in the hopes of + * speeding up the filesystem. We hold the IOLOCK so we cannot + * do a synchronous scan. + */ + if (error == -ENOSPC && !cleared_space) { + cleared_space = true; + xfs_inode_free_blocks(ip->i_mount, false); + goto retry; + } /* * Check for running out of space */ |