All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 06/20] xfs: halt auto-reclamation activities while rebuilding rmap
Date: Thu, 22 Feb 2018 18:02:21 -0800	[thread overview]
Message-ID: <151935134185.22097.12332431438284992923.stgit@magnolia> (raw)
In-Reply-To: <151935130484.22097.9694510081310029779.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

Rebuilding the reverse-mapping tree requires us to quiesce all inodes in
the filesystem, so we must stop background reclamation of post-EOF and
CoW prealloc blocks.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_icache.c |   18 ++++++++++++++++++
 fs/xfs/xfs_icache.h |    3 +++
 2 files changed, 21 insertions(+)


diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index d53a316..52f5ab0 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -1781,3 +1781,21 @@ xfs_inode_clear_cowblocks_tag(
 	return __xfs_inode_clear_blocks_tag(ip,
 			trace_xfs_perag_clear_cowblocks, XFS_ICI_COWBLOCKS_TAG);
 }
+
+/* Disable post-EOF and CoW block auto-reclamation. */
+void
+xfs_icache_disable_reclaim(
+	struct xfs_mount	*mp)
+{
+	cancel_delayed_work_sync(&mp->m_eofblocks_work);
+	cancel_delayed_work_sync(&mp->m_cowblocks_work);
+}
+
+/* Enable post-EOF and CoW block auto-reclamation. */
+void
+xfs_icache_enable_reclaim(
+	struct xfs_mount	*mp)
+{
+	xfs_queue_eofblocks(mp);
+	xfs_queue_cowblocks(mp);
+}
diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h
index d4a7758..d69a0f5 100644
--- a/fs/xfs/xfs_icache.h
+++ b/fs/xfs/xfs_icache.h
@@ -131,4 +131,7 @@ xfs_fs_eofblocks_from_user(
 int xfs_icache_inode_is_allocated(struct xfs_mount *mp, struct xfs_trans *tp,
 				  xfs_ino_t ino, bool *inuse);
 
+void xfs_icache_disable_reclaim(struct xfs_mount *mp);
+void xfs_icache_enable_reclaim(struct xfs_mount *mp);
+
 #endif


  parent reply	other threads:[~2018-02-23  2:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23  2:01 [PATCH v12 00/20] xfs: online repair support Darrick J. Wong
2018-02-23  2:01 ` [PATCH 01/20] xfs: add helpers to calculate btree size Darrick J. Wong
2018-02-23  2:01 ` [PATCH 02/20] xfs: expose various functions to repair code Darrick J. Wong
2018-02-23  2:02 ` [PATCH 03/20] xfs: add repair helpers for the reverse mapping btree Darrick J. Wong
2018-02-23  2:02 ` [PATCH 04/20] xfs: add repair helpers for the reference count btree Darrick J. Wong
2018-02-23  2:02 ` [PATCH 05/20] xfs: add BMAPI_NORMAP flag to perform block remapping without updating rmpabt Darrick J. Wong
2018-02-23  2:02 ` Darrick J. Wong [this message]
2018-02-23  2:02 ` [PATCH 07/20] xfs: create tracepoints for online repair Darrick J. Wong
2018-02-23  2:02 ` [PATCH 08/20] xfs: implement the metadata repair ioctl flag Darrick J. Wong
2018-02-23  2:02 ` [PATCH 09/20] xfs: add helper routines for the repair code Darrick J. Wong
2018-02-23  2:02 ` [PATCH 10/20] xfs: repair superblocks Darrick J. Wong
2018-02-23  2:03 ` [PATCH 11/20] xfs: repair the AGF and AGFL Darrick J. Wong
2018-02-23  2:03 ` [PATCH 12/20] xfs: repair the AGI Darrick J. Wong
2018-02-23  2:03 ` [PATCH 13/20] xfs: repair free space btrees Darrick J. Wong
2018-02-23  2:03 ` [PATCH 14/20] xfs: repair inode btrees Darrick J. Wong
2018-02-23  2:03 ` [PATCH 15/20] xfs: repair the rmapbt Darrick J. Wong
2018-02-23  2:03 ` [PATCH 16/20] xfs: repair refcount btrees Darrick J. Wong
2018-02-23  2:03 ` [PATCH 17/20] xfs: repair inode records Darrick J. Wong
2018-02-23  2:03 ` [PATCH 18/20] xfs: repair inode forks Darrick J. Wong
2018-02-23  2:03 ` [PATCH 19/20] xfs: repair inode block maps Darrick J. Wong
2018-02-23  2:03 ` [PATCH 20/20] xfs: repair damaged symlinks Darrick J. Wong
2018-03-15 20:26 [PATCH v13 00/20] xfs-4.17: online repair support Darrick J. Wong
2018-03-15 20:26 ` [PATCH 06/20] xfs: halt auto-reclamation activities while rebuilding rmap Darrick J. Wong
2018-03-26 23:55 [PATCH v14 00/20] xfs-4.17: online repair support Darrick J. Wong
2018-03-26 23:56 ` [PATCH 06/20] xfs: halt auto-reclamation activities while rebuilding rmap Darrick J. Wong
2018-03-27 23:15   ` Dave Chinner
2018-03-27 23:50     ` Darrick J. Wong

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=151935134185.22097.12332431438284992923.stgit@magnolia \
    --to=darrick.wong@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.