summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/rtrmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/scrub/rtrmap.c')
-rw-r--r--fs/xfs/scrub/rtrmap.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/xfs/scrub/rtrmap.c b/fs/xfs/scrub/rtrmap.c
index f003ae48b3f7..1ba13287b6e6 100644
--- a/fs/xfs/scrub/rtrmap.c
+++ b/fs/xfs/scrub/rtrmap.c
@@ -25,6 +25,7 @@
#include "scrub/common.h"
#include "scrub/btree.h"
#include "scrub/trace.h"
+#include "scrub/repair.h"
/* Set us up with the realtime metadata locked. */
int
@@ -34,6 +35,20 @@ xchk_setup_rtrmapbt(
struct xfs_mount *mp = sc->mp;
int error = 0;
+#ifdef CONFIG_XFS_ONLINE_REPAIR
+ if (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR) {
+ /*
+ * Freeze out anything that can lock an inode. We reconstruct
+ * the rtrmapbt by reading inode bmaps with the rtrmapbt inode
+ * locked, which is only safe w.r.t. ABBA deadlocks if we're
+ * the only ones locking inodes.
+ */
+ error = xchk_fs_freeze(sc);
+ if (error)
+ return error;
+ }
+#endif
+
error = xchk_setup_fs(sc);
if (error)
return error;