xfs: don't ASSERT on corrupt ftype
authorEric Sandeen <sandeen@sandeen.net>
Tue, 23 Sep 2014 06:05:32 +0000 (16:05 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 23 Sep 2014 06:05:32 +0000 (16:05 +1000)
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>
fs/xfs/libxfs/xfs_da_format.c

index c9aee52a37e202987141ddaf1468fe7ee5b03094..7e42fdfd2f1de5f0732689de22aadcdf0c07282f 100644 (file)
@@ -270,7 +270,6 @@ xfs_dir3_data_get_ftype(
 {
        __uint8_t       ftype = dep->name[dep->namelen];
 
-       ASSERT(ftype < XFS_DIR3_FT_MAX);
        if (ftype >= XFS_DIR3_FT_MAX)
                return XFS_DIR3_FT_UNKNOWN;
        return ftype;