* Strange behavior of ext2fs_allocate_group_table()
@ 2015-07-30 8:50 Jan Kara
0 siblings, 0 replies; only message in thread
From: Jan Kara @ 2015-07-30 8:50 UTC (permalink / raw)
To: Ted Tso; +Cc: linux-ext4
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@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-07-30 8:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-30 8:50 Strange behavior of ext2fs_allocate_group_table() Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).