summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/rtsummary.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-03-12 14:49:02 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-06-01 21:16:32 -0700
commitf13e935a9e9f8c838ff5c997abf4083c8f999089 (patch)
tree2db2d3de9717af75d7079f435ebbe90510a924e5 /fs/xfs/scrub/rtsummary.c
parentdacab9b2f2af569d65b8e980ed49edf8914447de (diff)
xfs: online repair of realtime summariesrepair-fsfile-metadata_2020-06-01
Repair the online summary data. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/scrub/rtsummary.c')
-rw-r--r--fs/xfs/scrub/rtsummary.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/xfs/scrub/rtsummary.c b/fs/xfs/scrub/rtsummary.c
index a70f6f0267bc..0cc0807f7360 100644
--- a/fs/xfs/scrub/rtsummary.c
+++ b/fs/xfs/scrub/rtsummary.c
@@ -57,6 +57,7 @@ xchk_setup_rtsummary(
struct xfs_inode *ip)
{
struct xfs_mount *mp = sc->mp;
+ unsigned long long resblks = 0;
int error;
/*
@@ -67,7 +68,17 @@ xchk_setup_rtsummary(
if (IS_ERR(sc->xfile))
return PTR_ERR(sc->xfile);
- error = xchk_trans_alloc(sc, 0);
+ /*
+ * If we're doing a repair, we reserve 2x the summary blocks: once for
+ * the new summary contents and again for the bmbt blocks and the
+ * remapping operation.
+ */
+ if (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR) {
+ resblks = XFS_B_TO_FSB(sc->mp, sc->mp->m_rsumsize) * 2;
+ if (resblks > UINT_MAX)
+ return -EOPNOTSUPP;
+ }
+ error = xchk_trans_alloc(sc, resblks);
if (error)
return error;