Skip to content

Commit

Permalink
ext4: refactor code to read directory blocks into ext4_read_dirblock()
Browse files Browse the repository at this point in the history
The code to read in directory blocks and verify their metadata
checksums was replicated in ten different places across
fs/ext4/namei.c, and the code was buggy in subtle ways in a number of
those replicated sites.  In some cases, ext4_error() was called with a
training newline.  In others, in particularly in empty_dir(), it was
possible to call ext4_dirent_csum_verify() on an index block, which
would trigger false warnings requesting the system adminsitrator to
run e2fsck.

By refactoring the code, we make the code more readable, as well as
shrinking the compiled object file by over 700 bytes and 50 lines of
code.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Theodore Ts'o committed Feb 15, 2013
1 parent 01a523e commit dc6982f
Showing 1 changed file with 119 additions and 172 deletions.
Loading

0 comments on commit dc6982f

Please sign in to comment.