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]
Date:	Thu, 20 Aug 2009 12:10:35 +0530
From:	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
To:	"Theodore Ts'o" <tytso@....edu>
Cc:	linux-ext4@...r.kernel.org, Andreas Dilger <adilger@....com>,
	Alex Tomas <bzzz@....com>
Subject: Re: [PATCH, RFC -V2 4/4] ext4: Avoid group preallocation for
	closed files

On Sun, Aug 09, 2009 at 11:23:55PM -0400, Theodore Ts'o wrote:
....

> 
>  static inline void ext4_unlock_group(struct super_block *sb,
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index a103cb0..6c7be0d 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -4191,9 +4191,17 @@ static void ext4_mb_group_or_file(struct ext4_allocation_context *ac)
>  		return;
> 
>  	size = ac->ac_o_ex.fe_logical + ac->ac_o_ex.fe_len;
> -	isize = i_size_read(ac->ac_inode) >> bsbits;
> +	isize = (i_size_read(ac->ac_inode) + ac->ac_sb->s_blocksize - 1)
> +		>> bsbits;
>  	size = max(size, isize);
> 
> +	if ((size == isize) &&

What is this check supposed to help us ?. This would also imply we disable prealloc
only if we are allocating the last chunk in the file. Why not just

if (atomic_read(&ac->ac_inode->i_writecount) == 0) && !ext4_fs_is_busy(sbi) {
    ac->ac_flags |= EXT4_MB_HINT_NOPREALLOC;                                                                                  
}



> +	    ext4_fs_is_busy(sbi) &&
> +	    (atomic_read(&ac->ac_inode->i_writecount) == 0)) {
> +		ac->ac_flags |= EXT4_MB_HINT_NOPREALLOC;
> +		return;
> +	}

shouldn't it be !ext4_fs_is_busy(sbi) ?. Can you also write function documentation
for ext4_fs_is_busy. I found in confusing that you are decrementing s_lock_busy
if we are going to spin on spin_lock.


> +
>  	/* don't use group allocation for large files */
>  	if (size >= sbi->s_mb_stream_request) {
>  		ac->ac_flags |= EXT4_MB_STREAM_ALLOC;
> -- 

-aneesh
--
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