From: Theodore Ts'o Date: Sat, 17 Jul 2021 03:10:52 +0000 (-0400) Subject: libext2fs: avoid forking a single thread in ext2fs_rw_bitmaps() X-Git-Tag: v1.46.3~14 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=d0b6b64f62eff5c7545be8b71adf6fd537613a90;p=tools%2Fe2fsprogs.git libext2fs: avoid forking a single thread in ext2fs_rw_bitmaps() https://github.com/tytso/e2fsprogs/issues/67 Signed-off-by: Theodore Ts'o --- diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c index d760064..ba5de8b 100644 --- a/lib/ext2fs/rw_bitmaps.c +++ b/lib/ext2fs/rw_bitmaps.c @@ -563,7 +563,7 @@ errcode_t ext2fs_rw_bitmaps(ext2_filsys fs, int flags, int num_threads) if (ext2fs_has_feature_flex_bg(fs->super)) { average_group = (average_group / flexbg_size) * flexbg_size; } - if (average_group == 0) + if ((num_threads <= 1) || (average_group == 0)) goto fallback; io_channel_set_options(fs->io, "cache=off");