Skip to content

Commit 1433f8f

Browse files
author
Darrick J. Wong
committed
xfs: repair realtime group superblock
Repair the realtime superblock if it has become out of date with the primary superblock. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent 3f1bdf5 commit 1433f8f

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

fs/xfs/scrub/repair.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,11 @@ int xrep_metapath(struct xfs_scrub *sc);
146146
#ifdef CONFIG_XFS_RT
147147
int xrep_rtbitmap(struct xfs_scrub *sc);
148148
int xrep_rtsummary(struct xfs_scrub *sc);
149+
int xrep_rgsuperblock(struct xfs_scrub *sc);
149150
#else
150151
# define xrep_rtbitmap xrep_notsupported
151152
# define xrep_rtsummary xrep_notsupported
153+
# define xrep_rgsuperblock xrep_notsupported
152154
#endif /* CONFIG_XFS_RT */
153155

154156
#ifdef CONFIG_XFS_QUOTA
@@ -253,6 +255,7 @@ static inline int xrep_setup_symlink(struct xfs_scrub *sc, unsigned int *x)
253255
#define xrep_symlink xrep_notsupported
254256
#define xrep_dirtree xrep_notsupported
255257
#define xrep_metapath xrep_notsupported
258+
#define xrep_rgsuperblock xrep_notsupported
256259

257260
#endif /* CONFIG_XFS_ONLINE_REPAIR */
258261

fs/xfs/scrub/rgsuper.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010
#include "xfs_trans_resv.h"
1111
#include "xfs_mount.h"
1212
#include "xfs_rtgroup.h"
13+
#include "xfs_log_format.h"
14+
#include "xfs_trans.h"
15+
#include "xfs_sb.h"
1316
#include "scrub/scrub.h"
1417
#include "scrub/common.h"
18+
#include "scrub/repair.h"
1519

1620
/* Set us up with a transaction and an empty context. */
1721
int
@@ -66,3 +70,15 @@ xchk_rgsuperblock(
6670
xchk_rgsuperblock_xref(sc);
6771
return 0;
6872
}
73+
74+
#ifdef CONFIG_XFS_ONLINE_REPAIR
75+
int
76+
xrep_rgsuperblock(
77+
struct xfs_scrub *sc)
78+
{
79+
ASSERT(rtg_rgno(sc->sr.rtg) == 0);
80+
81+
xfs_log_sb(sc->tp);
82+
return 0;
83+
}
84+
#endif /* CONFIG_XFS_ONLINE_REPAIR */

fs/xfs/scrub/scrub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ static const struct xchk_meta_ops meta_scrub_ops[] = {
456456
.setup = xchk_setup_rgsuperblock,
457457
.scrub = xchk_rgsuperblock,
458458
.has = xfs_has_rtsb,
459-
.repair = xrep_notsupported,
459+
.repair = xrep_rgsuperblock,
460460
},
461461
};
462462

0 commit comments

Comments
 (0)