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>] [day] [month] [year] [list]
Message-ID: <20150730085037.GA21939@quack.suse.cz>
Date:	Thu, 30 Jul 2015 10:50:37 +0200
From:	Jan Kara <jack@...e.cz>
To:	Ted Tso <tytso@....edu>
Cc:	linux-ext4@...r.kernel.org
Subject: Strange behavior of ext2fs_allocate_group_table()

Hello,

when doing refactoring of the resize code (so that we can easily handle
setting of 64-bit feature and increasing number of reserved inodes from
tune2fs) I've noticed that ext2fs_allocate_group_table() has somewhat
strange behavior. It updates allocation statistics only if FLEX_BG feature
is enabled. Actually the resize code doesn't get the allocation statistics
wrong only because it recomputes everything when resizing it done. Why is
that? It would seem more logical to update the statistics either always or
never...

Independently of when the allocation statistics get updated, it would seem
as a saner interface to mark allocated structures both in the provided
bitmap and in fs->block_map and define that the provided bitmap is simply a
bitmap of blocks that can be used for allocation. That would simplify the
resize code which is the only one providing a special bitmap...

Even better, we could teach ext2fs_get_free_blocks() to use
->get_alloc_block callback for allocating blocks if available. That way
resize could implement it's checking of reserved map when allocating new
blocks and we would not have to clutter ext2fs_allocate_group_table() with
the extra bitmap. Admittedly that would mean extending ->get_alloc_block
prototype to take range acceptable for allocation as well. But that's not
that hard to do. 

It may be that I'm missing something and there's a good reason why things
are the way they are. So would the above changes (or some of them) look
sane to you?

								Honza
-- 
Jan Kara <jack@...e.com>
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