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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 5 Sep 2018 07:54:29 +0200
From:   Torsten Hilbrich <torsten.hilbrich@...unet.com>
To:     Theodore Ts'o <tytso@....edu>,
        Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 1/2] ext4: fix online resize's handling of a too-small
 final block group

Am 04.09.2018 um 04:25 schrieb Theodore Ts'o:
> diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
> index e5fb38451a73..33655a6eff4d 100644
> --- a/fs/ext4/resize.c
> +++ b/fs/ext4/resize.c
> @@ -1986,6 +1986,26 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
>  		}
>  	}
>  
> +	/*
> +	 * Make sure the last group has enough space so that it's
> +	 * guaranteed to have enough space for all metadata blocks
> +	 * that it might need to hold.  (We might not need to store
> +	 * the inode table blocks in the last block group, but there
> +	 * will be cases where this might be needed.)
> +	 */
> +	if ((ext4_group_first_block_no(sb, n_group) +
> +	     ext4_group_overhead_blocks(sb, n_group) + 2 +
> +	     sbi->s_itb_per_group + sbi->s_cluster_ratio) >= n_blocks_count) {
> +		n_blocks_count = ext4_group_first_block_no(sb, n_group);
> +		n_group--;
> +		n_blocks_count_retry = 0;
> +		if (resize_inode) {
> +			iput(resize_inode);
> +			resize_inode = NULL;
> +		}
> +		goto retry;
> +	}
> +
>  	/* extend the last group */
>  	if (n_group == o_group)
>  		add = n_blocks_count - o_blocks_count;
> 

I successfully tested your fix in our system test where the problem was
initially found.

Thank you,

	Torsten

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ