Thread (13 messages) 13 messages, 2 authors, 2020-02-10

Re: [PATCH 2/3] ext2fs: Implement dir entry creation in htree directories

From: Jan Kara <jack@suse.cz>
Date: 2020-02-06 10:07:56

On Wed 05-02-20 10:50:16, Andreas Dilger wrote:
On Feb 5, 2020, at 3:01 AM, Jan Kara [off-list ref] wrote:
quoted
Implement proper creation of new directory entries in htree directories
in ext2fs_link(). So far we just cleared EXT2_INDEX_FL and treated
directory as unindexed however this results in mismatched checksums if
metadata checksums are in use because checksums are placed in different
places depending on htree node type.
I'm definitely not agains this, as I believe it will also speed up e2fsck
for cases where a lot of entries are inserted into lost+found (sometimes
many millions of files).  Currently e2fsck linearly scans the whole dir
for each insert, rather than saving the offset of the last entry.  I have
a patch to fix that, but it needed several API changes and got bogged down
in performance testing and never made it out to the list.

One potential risk is that if a directory is corrupted in some way, then
the htree index cannot always be trusted to do inserts during e2fsck, so
it might still have to fall back to clearing the flag and doing a linear
insertion.
Well, but pass 2 checks internal consistency of all directories so if htree
in lost+found is not usable, it will be detected and handled. So in pass 3
we should have usable lost+found (possibly without htree) to use.

Also note that I have not implemented conversion of directory into indexed
one so in the normal case lost+found will be just an ordinary linear
directory.

								Honza
-- 
Jan Kara [off-list ref]
SUSE Labs, CR
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help