This is a note to let you know that I've just added the patch titled ext4: correct offset of gdb backup in non meta_bg group to update_backups to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ext4-correct-offset-of-gdb-backup-in-non-meta_bg-group-to-update_backups.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 31f13421c004a420c0e9d288859c9ea9259ea0cc Mon Sep 17 00:00:00 2001 From: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx> Date: Sun, 27 Aug 2023 01:47:00 +0800 Subject: ext4: correct offset of gdb backup in non meta_bg group to update_backups From: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx> commit 31f13421c004a420c0e9d288859c9ea9259ea0cc upstream. Commit 0aeaa2559d6d5 ("ext4: fix corruption when online resizing a 1K bigalloc fs") found that primary superblock's offset in its group is not equal to offset of backup superblock in its group when block size is 1K and bigalloc is enabled. As group descriptor blocks are right after superblock, we can't pass block number of gdb to update_backups for the same reason. The root casue of the issue above is that leading 1K padding block is count as data block offset for primary block while backup block has no padding block offset in its group. Remove padding data block count to fix the issue for gdb backups. For meta_bg case, update_backups treat blk_off as block number, do no conversion in this case. Signed-off-by: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx> Reviewed-by: Theodore Ts'o <tytso@xxxxxxx> Link: https://lore.kernel.org/r/20230826174712.4059355-2-shikemeng@xxxxxxxxxxxxxxx Signed-off-by: Theodore Ts'o <tytso@xxxxxxx> Cc: stable@xxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/ext4/resize.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -1602,6 +1602,8 @@ exit_journal: int gdb_num_end = ((group + flex_gd->count - 1) / EXT4_DESC_PER_BLOCK(sb)); int meta_bg = ext4_has_feature_meta_bg(sb); + sector_t padding_blocks = meta_bg ? 0 : sbi->s_sbh->b_blocknr - + ext4_group_first_block_no(sb, 0); sector_t old_gdb = 0; update_backups(sb, ext4_group_first_block_no(sb, 0), @@ -1613,8 +1615,8 @@ exit_journal: gdb_num); if (old_gdb == gdb_bh->b_blocknr) continue; - update_backups(sb, gdb_bh->b_blocknr, gdb_bh->b_data, - gdb_bh->b_size, meta_bg); + update_backups(sb, gdb_bh->b_blocknr - padding_blocks, + gdb_bh->b_data, gdb_bh->b_size, meta_bg); old_gdb = gdb_bh->b_blocknr; } } Patches currently in stable-queue which might be from shikemeng@xxxxxxxxxxxxxxx are queue-6.1/ext4-correct-offset-of-gdb-backup-in-non-meta_bg-group-to-update_backups.patch queue-6.1/ext4-remove-gdb-backup-copy-for-meta-bg-in-setup_new_flex_group_blocks.patch queue-6.1/ext4-add-missed-brelse-in-update_backups.patch queue-6.1/ext4-correct-return-value-of-ext4_convert_meta_bg.patch