Commit 426d15ad authored by Josh Triplett's avatar Josh Triplett Committed by Theodore Ts'o

ext4: don't run ext4lazyinit for read-only filesystems

On a read-only filesystem, we won't invoke the block allocator, so we
don't need to prefetch the block bitmaps.

This avoids starting and running the ext4lazyinit thread at all on a
system with no read-write ext4 filesystems (for instance, a container VM
with read-only filesystems underneath an overlayfs).

Fixes: 21175ca4 ("ext4: make prefetch_block_bitmaps default")
Signed-off-by: default avatarJosh Triplett <josh@joshtriplett.org>
Reviewed-by: default avatarLukas Czerner <lczerner@redhat.com>
Link: https://lore.kernel.org/r/48b41da1498fcac3287e2e06b660680646c1c050.1659323972.git.josh@joshtriplett.orgSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 2d544ec9
...@@ -3973,9 +3973,9 @@ int ext4_register_li_request(struct super_block *sb, ...@@ -3973,9 +3973,9 @@ int ext4_register_li_request(struct super_block *sb,
goto out; goto out;
} }
if (test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS) && if (sb_rdonly(sb) ||
(first_not_zeroed == ngroups || sb_rdonly(sb) || (test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS) &&
!test_opt(sb, INIT_INODE_TABLE))) (first_not_zeroed == ngroups || !test_opt(sb, INIT_INODE_TABLE))))
goto out; goto out;
elr = ext4_li_request_new(sb, first_not_zeroed); elr = ext4_li_request_new(sb, first_not_zeroed);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment