Commit b882b0f8 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Carlos Maiolino
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent 6a18765b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -713,6 +713,11 @@ xlog_recover_do_primary_sb_buffer(
	 */
	xfs_sb_from_disk(&mp->m_sb, dsb);

	if (mp->m_sb.sb_agcount < orig_agcount) {
		xfs_alert(mp, "Shrinking AG count in log recovery not supported");
		return -EFSCORRUPTED;
	}

	/*
	 * Initialize the new perags, and also update various block and inode
	 * allocator setting based off the number of AGs or total blocks.