diff -Nru e2fsprogs-1.47.0/debian/changelog e2fsprogs-1.47.0/debian/changelog --- e2fsprogs-1.47.0/debian/changelog 2023-07-27 06:26:17.000000000 +1200 +++ e2fsprogs-1.47.0/debian/changelog 2023-10-09 14:33:30.000000000 +1300 @@ -1,3 +1,13 @@ +e2fsprogs (1.47.0-2ubuntu1.1) mantic; urgency=medium + + * Fix superblock checksum mismatch during resize2fs operations, + most notably during online resize of cloud images during boot. + Read the superblock with Direct I/O to ensure we get the correct + view of the disk. (LP: #2036467) + - lp2036467-resize2fs-use-Direct-I-O-when-reading-the-superblock.patch + + -- Matthew Ruffell Mon, 09 Oct 2023 14:33:30 +1300 + e2fsprogs (1.47.0-2ubuntu1) mantic; urgency=medium * Merge from Debian Unstable. Remaining changes: diff -Nru e2fsprogs-1.47.0/debian/patches/lp2036467-resize2fs-use-Direct-I-O-when-reading-the-superblock.patch e2fsprogs-1.47.0/debian/patches/lp2036467-resize2fs-use-Direct-I-O-when-reading-the-superblock.patch --- e2fsprogs-1.47.0/debian/patches/lp2036467-resize2fs-use-Direct-I-O-when-reading-the-superblock.patch 1970-01-01 12:00:00.000000000 +1200 +++ e2fsprogs-1.47.0/debian/patches/lp2036467-resize2fs-use-Direct-I-O-when-reading-the-superblock.patch 2023-10-09 14:33:30.000000000 +1300 @@ -0,0 +1,32 @@ +commit 43a498e938887956f393b5e45ea6ac79cc5f4b84 +Author: Theodore Ts'o +Date: Thu, 15 Jun 2023 00:17:01 -0400 +Subject: resize2fs: use Direct I/O when reading the superblock for + online resizes + + If the file system is mounted, the superblock can be changing while + resize2fs is trying to read the superblock, resulting in checksum + failures. One way of avoiding this problem is read the superblock + using Direct I/O, since the kernel makes sure that what gets written + to disk is self-consistent. + + Suggested-by: Krister Johansen + Signed-off-by: Theodore Ts'o +Bug-Ubuntu: https://bugs.launchpad.net/bugs/2036467 +Bug: https://lore.kernel.org/linux-ext4/20230609042239.GA1436857@mit.edu/ +Origin: upstream, https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=43a498e938887956f393b5e45ea6ac79cc5f4b84 +Last-Update: 2023-10-09 + +Index: e2fsprogs-1.47.0/resize/main.c +=================================================================== +--- e2fsprogs-1.47.0.orig/resize/main.c 2023-10-09 14:28:23.549873073 +1300 ++++ e2fsprogs-1.47.0/resize/main.c 2023-10-09 14:28:23.545873129 +1300 +@@ -409,6 +409,8 @@ + + if (!(mount_flags & EXT2_MF_MOUNTED) && !print_min_size) + io_flags = EXT2_FLAG_RW | EXT2_FLAG_EXCLUSIVE; ++ if (mount_flags & EXT2_MF_MOUNTED) ++ io_flags |= EXT2_FLAG_DIRECT_IO; + + io_flags |= EXT2_FLAG_64BITS | EXT2_FLAG_THREADS; + if (undo_file) { diff -Nru e2fsprogs-1.47.0/debian/patches/series e2fsprogs-1.47.0/debian/patches/series --- e2fsprogs-1.47.0/debian/patches/series 2023-07-27 06:25:43.000000000 +1200 +++ e2fsprogs-1.47.0/debian/patches/series 2023-10-09 14:33:30.000000000 +1300 @@ -1,2 +1,3 @@ disable-metadata_csum_seed-and-orphan_file-by-default default-to-4k.patch +lp2036467-resize2fs-use-Direct-I-O-when-reading-the-superblock.patch