]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: ensure .. is set sanely when rebuilding dir
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 1 Jun 2015 01:17:39 +0000 (11:17 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 1 Jun 2015 01:17:39 +0000 (11:17 +1000)
commit01914f06a1827e5dcc8093d1e6228d3e4ff5dc60
tree65629e86478a9b9c8eb5d39d439a1eb94a2ccc90
parent0519f662c86a7a3396fc2eba079f180ac46cbf5e
xfs_repair: ensure .. is set sanely when rebuilding dir

When we're rebuilding a directory, ensure that we reinitialize the
directory with a sane parent ('..') inode value.  If we don't, the
error return from xfs_dir_init() is ignored, and the rebuild process
becomes confused and leaves the directory corrupt.  If repair later
discovers that the rebuilt directory is an orphan, it'll try to attach
it to lost+found and abort on the corrupted directory.  Also fix
ignoring the return value of xfs_dir_init().

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
include/xfs_dir2.h
libxfs/xfs_dir2_priv.h
repair/phase6.c