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:	Mon, 25 Aug 2014 11:19:39 +0400
From:	Dmitry Monakhov <dmonakhov@...nvz.org>
To:	Theodore Ts'o <tytso@....edu>
Cc:	linux-ext4@...r.kernel.org, lczerner@...hat.com
Subject: Re: [PATCH 3/5] ext4_zero_range: fix incorect journal credits reservation

On Sat, 23 Aug 2014 15:08:35 -0400, "Theodore Ts'o" <tytso@....edu> wrote:
> On Fri, Aug 22, 2014 at 03:32:25PM +0400, Dmitry Monakhov wrote:
> > -	handle = ext4_journal_start(inode, EXT4_HT_MISC, 4);
> > +	/* In worst case we have to writeout two nonadjacent unwritten blocks */
> > +	credits = ext4_chunk_trans_blocks(inode, 1) * 2 -
> > +		EXT4_META_TRANS_BLOCKS(inode->i_sb);
> 
> This looks like it would be a massive over-estimate, since it includes
> the block group allocation bitmaps, which we wouldn't need to update,
> no?
  Oh. You right. groups metadata/quota should not be affected.
> 
> Wouldn't
> 
> 	credts = ext4_index_trans_blocks(inode, 1, 1) * 2;
Yes, but ext4_index_trans_blocks is statically defined in inode.c,
but since zero_range works only for extent based
ext4_ext_index_trans_blocks is sufficient. Also we must reserve 2 block
for data. So final calculation looks like follows:
credits =  ext4_ext_index_trans_blocks(inode, 2) + 2


View attachment "0001-ext4_zero_range-fix-incorect-journal-credits-reserva.patch" of type "text/x-patch" (1323 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ