lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220803070001.iygdreewgveotfwx@fedora>
Date:   Wed, 3 Aug 2022 09:00:01 +0200
From:   Lukas Czerner <lczerner@...hat.com>
To:     Josh Triplett <josh@...htriplett.org>
Cc:     Theodore Ts'o <tytso@....edu>,
        Andreas Dilger <adilger.kernel@...ger.ca>,
        linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ext4: Don't run ext4lazyinit for read-only filesystems

On Sun, Jul 31, 2022 at 08:24:53PM -0700, Josh Triplett wrote:
> 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: 21175ca434c5 ("ext4: make prefetch_block_bitmaps default")
> Signed-off-by: Josh Triplett <josh@...htriplett.org>
> ---

Looks good to me.

Reviewed-by: Lukas Czerner <lczerner@...hat.com>

> 
> Tested in a VM, with a read-only ext4 root filesystem. Confirmed that
> ext4lazyinit starts without this patch, and does not start with this
> patch.
> 
> (For a future merge window, not the current one. Please let me know if I
> need to re-send this at a later, more convenient time.)
> 
>  fs/ext4/super.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 845f2f8aee5f..20437acc8865 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -3973,9 +3973,9 @@ int ext4_register_li_request(struct super_block *sb,
>  		goto out;
>  	}
>  
> -	if (test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS) &&
> -	    (first_not_zeroed == ngroups || sb_rdonly(sb) ||
> -	     !test_opt(sb, INIT_INODE_TABLE)))
> +	if (sb_rdonly(sb) ||
> +	    (test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS) &&
> +	     (first_not_zeroed == ngroups || !test_opt(sb, INIT_INODE_TABLE))))
>  		goto out;
>  
>  	elr = ext4_li_request_new(sb, first_not_zeroed);
> -- 
> 2.36.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ