diff mbox

[v2,4/5] xfs: free cowblocks and retry on buffered write ENOSPC

Message ID 1484157249-464-5-git-send-email-bfoster@redhat.com (mailing list archive)
State Accepted
Headers show

Commit Message

Brian Foster Jan. 11, 2017, 5:54 p.m. UTC
XFS runs an eofblocks reclaim scan before returning an ENOSPC error to
userspace for buffered writes. This facilitates aggressive speculative
preallocation without causing user visible side effects such as
premature ENOSPC.

Run a cowblocks scan in the same situation to reclaim lingering COW fork
preallocation throughout the filesystem.

Signed-off-by: Brian Foster <bfoster@redhat.com>
---
 fs/xfs/xfs_file.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Christoph Hellwig Jan. 13, 2017, 5:12 p.m. UTC | #1
On Wed, Jan 11, 2017 at 12:54:08PM -0500, Brian Foster wrote:
> XFS runs an eofblocks reclaim scan before returning an ENOSPC error to
> userspace for buffered writes. This facilitates aggressive speculative
> preallocation without causing user visible side effects such as
> premature ENOSPC.
> 
> Run a cowblocks scan in the same situation to reclaim lingering COW fork
> preallocation throughout the filesystem.

This should probably go into 4.10-rc..

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index bbb9eb6..ef7eaa6 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -655,6 +655,7 @@  xfs_file_buffered_aio_write(
 		eofb.eof_scan_owner = ip->i_ino; /* for locking */
 		eofb.eof_flags = XFS_EOF_FLAGS_SYNC;
 		xfs_icache_free_eofblocks(ip->i_mount, &eofb);
+		xfs_icache_free_cowblocks(ip->i_mount, &eofb);
 		goto write_retry;
 	}