From ce4cab74d9fadd5fe8e8045242cb745be397e873 Mon Sep 17 00:00:00 2001 From: OBS User zkalmar Date: Fri, 29 Nov 2019 13:41:34 +0000 Subject: [PATCH] Set link to e2fsprogs.13246 via maintenance_release request Rev SUSE:SLE-15:Update/4 Md5 17a0b9447be3ce8ef4d2e09a5c30c6f8 2019-11-29 13:41:34 zkalmar None --- e2fsprogs.changes | 6 +++ e2fsprogs.spec | 2 + ...minimum-size-estimates-more-reliable.patch | 46 +++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 resize2fs-Make-minimum-size-estimates-more-reliable.patch diff --git a/e2fsprogs.changes b/e2fsprogs.changes index 1ab6a7c..d2b6d12 100644 --- a/e2fsprogs.changes +++ b/e2fsprogs.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Nov 11 10:21:14 UTC 2019 - Jan Kara + +- resize2fs-Make-minimum-size-estimates-more-reliable.patch: resize2fs: Make + minimum size estimates more reliable for mounted fs (bsc#1154295) + ------------------------------------------------------------------- Mon Sep 30 15:07:58 UTC 2019 - Jan Kara diff --git a/e2fsprogs.spec b/e2fsprogs.spec index 7569e2c..d526a15 100644 --- a/e2fsprogs.spec +++ b/e2fsprogs.spec @@ -85,6 +85,7 @@ Patch6: libext2fs-Fix-fsync-2-detection.patch Patch7: e2fsck-check-and-fix-tails-of-all-bitmaps.patch Patch8: libext2fs-call-fsync-2-to-clear-stale-errors-for-a-n.patch Patch9: libsupport-add-checks-to-prevent-buffer-overrun-bugs.patch +Patch10: resize2fs-Make-minimum-size-estimates-more-reliable.patch # Do not suppress make commands BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -233,6 +234,7 @@ Development files for the com_err error message display library. Static librarie %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 cp %{SOURCE2} . %build diff --git a/resize2fs-Make-minimum-size-estimates-more-reliable.patch b/resize2fs-Make-minimum-size-estimates-more-reliable.patch new file mode 100644 index 0000000..71f1412 --- /dev/null +++ b/resize2fs-Make-minimum-size-estimates-more-reliable.patch @@ -0,0 +1,46 @@ +From 1c580154d4e1ae3b4f13cf58a85f8a5ae792fbfc Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Fri, 18 Oct 2019 14:41:10 +0200 +Subject: [PATCH] resize2fs: Make minimum size estimates more reliable for + mounted fs +References: bsc#1154295 + +Currently, the estimate of minimum filesystem size is using free blocks +counter in the superblock. The counter generally doesn't get updated +while the filesystem is mounted and thus the estimate is very unreliable +for a mounted filesystem. For some usecases such as automated +partitioning proposal to the user it is desirable that the estimate of +minimum filesystem size is reasonably accurate even for a mounted +filesystem. So use group descriptor counters of free blocks for the +estimate of minimum filesystem size. These get updated together with +block being allocated and so the resulting estimate is more accurate. + +Signed-off-by: Jan Kara +Acked-by: Jan Kara +--- + resize/resize2fs.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/resize/resize2fs.c b/resize/resize2fs.c +index c2e10471bfd1..8a3d08db19f3 100644 +--- a/resize/resize2fs.c ++++ b/resize/resize2fs.c +@@ -2926,11 +2926,11 @@ blk64_t calculate_minimum_resize_size(ext2_filsys fs, int flags) + fs->super->s_reserved_gdt_blocks; + + /* calculate how many blocks are needed for data */ +- data_needed = ext2fs_blocks_count(fs->super) - +- ext2fs_free_blocks_count(fs->super); +- +- for (grp = 0; grp < fs->group_desc_count; grp++) ++ data_needed = ext2fs_blocks_count(fs->super); ++ for (grp = 0; grp < fs->group_desc_count; grp++) { + data_needed -= calc_group_overhead(fs, grp, old_desc_blocks); ++ data_needed -= ext2fs_bg_free_blocks_count(fs, grp); ++ } + #ifdef RESIZE2FS_DEBUG + if (flags & RESIZE_DEBUG_MIN_CALC) + printf("fs requires %llu data blocks.\n", data_needed); +-- +2.16.4 +