summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-10-14 08:04:53 +0200
committerCarlos Maiolino <cem@kernel.org>2024-10-22 13:37:18 +0200
commitb882b0f8138ffa935834e775953f1630f89bbb62 (patch)
tree5ff50966688ec22acb5947dfbb5b23d816ccd8da /fs
parent6a18765b54e2e52aebcdb84c3b4f4d1f7cb2c0ca (diff)
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_buf_item_recover.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/xfs/xfs_buf_item_recover.c b/fs/xfs/xfs_buf_item_recover.c
index edf1162a8c9d..a839ff5dcaa9 100644
--- a/fs/xfs/xfs_buf_item_recover.c
+++ b/fs/xfs/xfs_buf_item_recover.c
@@ -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.