Skip to content

Commit b882b0f

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
xfs: error out when a superblock buffer update reduces the agcount
XFS currently does not support reducing the agcount, so error out if a logged sb buffer tries to shrink the agcount. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
1 parent 6a18765 commit b882b0f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/xfs/xfs_buf_item_recover.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,11 @@ xlog_recover_do_primary_sb_buffer(
713713
*/
714714
xfs_sb_from_disk(&mp->m_sb, dsb);
715715

716+
if (mp->m_sb.sb_agcount < orig_agcount) {
717+
xfs_alert(mp, "Shrinking AG count in log recovery not supported");
718+
return -EFSCORRUPTED;
719+
}
720+
716721
/*
717722
* Initialize the new perags, and also update various block and inode
718723
* allocator setting based off the number of AGs or total blocks.

0 commit comments

Comments
 (0)