Skip to content

Commit 75e60ad

Browse files
joshtriplettgregkh
authored andcommitted
ext4: don't run ext4lazyinit for read-only filesystems
[ Upstream commit 426d15a ] 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: 21175ca ("ext4: make prefetch_block_bitmaps default") Signed-off-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Lukas Czerner <lczerner@redhat.com> Link: https://lore.kernel.org/r/48b41da1498fcac3287e2e06b660680646c1c050.1659323972.git.josh@joshtriplett.org Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 59cdd07 commit 75e60ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/ext4/super.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3953,9 +3953,9 @@ int ext4_register_li_request(struct super_block *sb,
39533953
goto out;
39543954
}
39553955

3956-
if (test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS) &&
3957-
(first_not_zeroed == ngroups || sb_rdonly(sb) ||
3958-
!test_opt(sb, INIT_INODE_TABLE)))
3956+
if (sb_rdonly(sb) ||
3957+
(test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS) &&
3958+
(first_not_zeroed == ngroups || !test_opt(sb, INIT_INODE_TABLE))))
39593959
goto out;
39603960

39613961
elr = ext4_li_request_new(sb, first_not_zeroed);

0 commit comments

Comments
 (0)