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] [day] [month] [year] [list]
Date:	Thu, 2 Feb 2012 17:01:18 +0100
From:	Jan Kara <jack@...e.cz>
To:	Kazuya Mio <k-mio@...jp.nec.com>
Cc:	ext4 <linux-ext4@...r.kernel.org>, Jan Kara <jack@...e.cz>,
	Andreas Dilger <adilger@...ger.ca>
Subject: Re: [PATCH 1/2] ext3: Don't call dquot_free_block() if we don't
 update anything

On Mon 30-01-12 17:41:25, Kazuya Mio wrote:
> dquot_free_block() is called in the end of ext3_new_blocks() and updates
> information of the inode structure. However, this update is not necessary
> if the number of blocks we requested is equal to the number of
> allocated blocks.
  This is obviously correct thing to do so I've merged this patch into
my tree. Thanks.

								Honza
> 
> Signed-off-by: Kazuya Mio <k-mio@...jp.nec.com>
> ---
>  fs/ext3/balloc.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
> index a203892..954a7d3 100644
> --- a/fs/ext3/balloc.c
> +++ b/fs/ext3/balloc.c
> @@ -1743,8 +1743,11 @@ allocated:
>  
>  	*errp = 0;
>  	brelse(bitmap_bh);
> -	dquot_free_block(inode, *count-num);
> -	*count = num;
> +
> +	if (num < *count) {
> +		dquot_free_block(inode, *count-num);
> +		*count = num;
> +	}
>  
>  	trace_ext3_allocate_blocks(inode, goal, num,
>  				   (unsigned long long)ret_block);
-- 
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
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