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: <alpine.LFD.2.00.1406041456210.2927@localhost.localdomain>
Date:	Wed, 4 Jun 2014 15:27:50 +0200 (CEST)
From:	Lukáš Czerner <lczerner@...hat.com>
To:	Namjae Jeon <namjae.jeon@...sung.com>
cc:	"Theodore Ts'o" <tytso@....edu>,
	linux-ext4 <linux-ext4@...r.kernel.org>,
	Ashish Sangwan <a.sangwan@...sung.com>
Subject: Re: [PATCH] ext4: fix COLLAPSE RANGE test failure when bigalloc is
 enable

On Wed, 4 Jun 2014, Namjae Jeon wrote:

> Date: Wed, 04 Jun 2014 17:08:45 +0900
> From: Namjae Jeon <namjae.jeon@...sung.com>
> To: Theodore Ts'o <tytso@....edu>
> Cc: linux-ext4 <linux-ext4@...r.kernel.org>,
>     Ashish Sangwan <a.sangwan@...sung.com>
> Subject: [PATCH] ext4: fix COLLAPSE RANGE test failure when bigalloc is enable
> 
> Blocks in collapse range should be collapsed per cluster unit when bigalloc
> is enable. If bigalloc is not enable, EXT4_CLUSTER_SIZE will be same with
> EXT4_BLOCK_SIZE.

I wonder why it is so ? Bigalloc only affects the way we allocate
and free blocks, it does not affect extent tree at all and so
freeing and allocating extents at the block boundary on bigalloc
file system should be just fine - underlying code should be able to
handle it.

It might be that there is some complication in shift_extent code
which is not obvious to me. Could you please describe the problem
and why this is needed little bit more ?

Have you done some testing with bigalloc enabled file system with
respect to collapse range ?

Thanks!
-Lukas

> 
> Signed-off-by: Namjae Jeon <namjae.jeon@...sung.com>
> Signed-off-by: Ashish Sangwan <a.sangwan@...sung.com>
> ---
>  fs/ext4/extents.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 4da228a..2b9f5f3 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -5403,16 +5403,13 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
>  	int ret;
>  
>  	/* Collapse range works only on fs block size aligned offsets. */
> -	if (offset & (EXT4_BLOCK_SIZE(sb) - 1) ||
> -	    len & (EXT4_BLOCK_SIZE(sb) - 1))
> +	if (offset & (EXT4_CLUSTER_SIZE(sb) - 1) ||
> +	    len & (EXT4_CLUSTER_SIZE(sb) - 1))
>  		return -EINVAL;
>  
>  	if (!S_ISREG(inode->i_mode))
>  		return -EINVAL;
>  
> -	if (EXT4_SB(inode->i_sb)->s_cluster_ratio > 1)
> -		return -EOPNOTSUPP;
> -
>  	trace_ext4_collapse_range(inode, offset, len);
>  
>  	punch_start = offset >> EXT4_BLOCK_SIZE_BITS(sb);
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ