linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 5/6] xfs: free cowblocks and retry on buffered write ENOSPC
Date: Mon, 28 Nov 2016 14:09:40 -0500	[thread overview]
Message-ID: <1480360181-20396-6-git-send-email-bfoster@redhat.com> (raw)
In-Reply-To: <1480360181-20396-1-git-send-email-bfoster@redhat.com>

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(+)

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index d818c16..7fd97c3 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -716,6 +716,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;
 	}
 
-- 
2.7.4


  parent reply	other threads:[~2016-11-28 19:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-28 19:09 [PATCH 0/6] xfs: basic cow fork speculative preallocation Brian Foster
2016-11-28 19:09 ` [PATCH 1/6] xfs: fiemap support for cow fork Brian Foster
2016-11-28 19:15   ` Darrick J. Wong
2016-11-28 19:31     ` Brian Foster
2016-11-30 19:30       ` Christoph Hellwig
2016-11-28 19:09 ` [PATCH 2/6] xfs: refactor iomap delalloc existing extent search into helper Brian Foster
2016-11-30  1:15   ` Darrick J. Wong
2016-11-28 19:09 ` [PATCH 3/6] xfs: logically separate iomap range from allocation range Brian Foster
2016-11-30  1:21   ` Darrick J. Wong
2016-11-28 19:09 ` [PATCH 4/6] xfs: reuse iomap delalloc code for COW fork reservation Brian Foster
2016-11-28 19:09 ` Brian Foster [this message]
2016-11-28 19:09 ` [PATCH 6/6] xfs: implement basic COW fork speculative preallocation Brian Foster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1480360181-20396-6-git-send-email-bfoster@redhat.com \
    --to=bfoster@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).