]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: dirent dtype presence is dependent on directory magic numbers
authorDave Chinner <dchinner@redhat.com>
Mon, 30 Sep 2013 03:15:19 +0000 (03:15 +0000)
committerRich Johnston <rjohnston@sgi.com>
Thu, 17 Oct 2013 19:46:56 +0000 (14:46 -0500)
commit41315687d9db9b50876401e7b0ee20dd77cfc712
tree606b6ec67bb115f42115b3438ebfe0c33b14c40e
parentea6a00d47a01bc1df218742784712a12929ab77e
xfs: dirent dtype presence is dependent on directory magic numbers

The determination of whether a directory entry contains a dtype
field originally was dependent on the filesystem having CRCs
enabled. This meant that the format for dtype being enabled could be
determined by checking the directory block magic number rather than
doing a feature bit check. This was useful in that it meant that we
didn't need to pass a struct xfs_mount around to functions that
were already supplied with a directory block header.

Unfortunately, the introduction of dtype fields into the v4
structure via a feature bit meant this "use the directory block
magic number" method of discriminating the dirent entry sizes is
broken. Hence we need to convert the places that use magic number
checks to use feature bit checks so that they work correctly and not
by chance.

The current code works on v4 filesystems only because the dirent
size roundup covers the extra byte needed by the dtype field in the
places where this problem occurs.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
db/check.c
include/xfs_dir2_format.h
libxfs/xfs_dir2_block.c
libxfs/xfs_dir2_sf.c
repair/dir2.c