Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfs: don't ASSERT on corrupt ftype

xfs_dir3_data_get_ftype() gets the file type off disk, but ASSERTs
if it's invalid:

ASSERT(type < XFS_DIR3_FT_MAX);

We shouldn't ASSERT on bad values read from disk. V3 dirs are
CRC-protected, but V2 dirs + ftype are not.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>


authored by

Eric Sandeen and committed by
Dave Chinner
fb040131 8af3dcd3

-1
-1
fs/xfs/libxfs/xfs_da_format.c
··· 270 270 { 271 271 __uint8_t ftype = dep->name[dep->namelen]; 272 272 273 - ASSERT(ftype < XFS_DIR3_FT_MAX); 274 273 if (ftype >= XFS_DIR3_FT_MAX) 275 274 return XFS_DIR3_FT_UNKNOWN; 276 275 return ftype;