瀏覽代碼

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>
Eric Sandeen 11 年之前
父節點
當前提交
fb04013156
共有 1 個文件被更改,包括 0 次插入1 次删除
  1. 0 1
      fs/xfs/libxfs/xfs_da_format.c

+ 0 - 1
fs/xfs/libxfs/xfs_da_format.c

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