Skip to content

Commit 426d15a

Browse files
joshtripletttytso
authored andcommitted
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: 21175ca ("ext4: make prefetch_block_bitmaps default") Signed-off-by: Josh Triplett <[email protected]> Reviewed-by: Lukas Czerner <[email protected]> Link: https://lore.kernel.org/r/48b41da1498fcac3287e2e06b660680646c1c050.1659323972.git.josh@joshtriplett.org Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 2d544ec commit 426d15a

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
@@ -3973,9 +3973,9 @@ int ext4_register_li_request(struct super_block *sb,
39733973
goto out;
39743974
}
39753975

3976-
if (test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS) &&
3977-
(first_not_zeroed == ngroups || sb_rdonly(sb) ||
3978-
!test_opt(sb, INIT_INODE_TABLE)))
3976+
if (sb_rdonly(sb) ||
3977+
(test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS) &&
3978+
(first_not_zeroed == ngroups || !test_opt(sb, INIT_INODE_TABLE))))
39793979
goto out;
39803980

39813981
elr = ext4_li_request_new(sb, first_not_zeroed);

0 commit comments

Comments
 (0)