~vcs-imports/e2fsprogs/trunk

Viewing all changes in revision 3713.

  • Committer: Theodore Ts'o
  • Author(s): Darrick J. Wong
  • Date: 2014-08-25 02:02:49 UTC
  • Revision ID: git-v1:4348709c5c1daebb1ad2307dbd37f3d04104634e
e2fsck: on BE, re-swap everything after a damaged dirent so salvage works correctly

On big-endian systems, if the dirent swap routine finds a rec_len that
it doesn't like, it continues processing the block as if rec_len == 8.
This means that the name field gets byte swapped, which means that
salvage will not detect the correct name length (unless the name has a
length that's an exact multiple of four bytes), and it'll discard the
entry (unnecessarily) and the rest of the dirent block.  Therefore,
swap the rest of the block back to disk order, run salvage, and
re-swap anything after the salvaged dirent.

The test case for this is f_inlinedata_repair if you run it on a BE
system.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: