aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_inode_buf.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/libxfs/xfs_inode_buf.c')
-rw-r--r--fs/xfs/libxfs/xfs_inode_buf.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
index dd483e2767f7..d93f9d918cfc 100644
--- a/fs/xfs/libxfs/xfs_inode_buf.c
+++ b/fs/xfs/libxfs/xfs_inode_buf.c
@@ -29,6 +29,7 @@
29#include "xfs_icache.h" 29#include "xfs_icache.h"
30#include "xfs_trans.h" 30#include "xfs_trans.h"
31#include "xfs_ialloc.h" 31#include "xfs_ialloc.h"
32#include "xfs_dir2.h"
32 33
33/* 34/*
34 * Check that none of the inode's in the buffer have a next 35 * Check that none of the inode's in the buffer have a next
@@ -386,6 +387,7 @@ xfs_dinode_verify(
386 xfs_ino_t ino, 387 xfs_ino_t ino,
387 struct xfs_dinode *dip) 388 struct xfs_dinode *dip)
388{ 389{
390 uint16_t mode;
389 uint16_t flags; 391 uint16_t flags;
390 uint64_t flags2; 392 uint64_t flags2;
391 393
@@ -396,8 +398,12 @@ xfs_dinode_verify(
396 if (be64_to_cpu(dip->di_size) & (1ULL << 63)) 398 if (be64_to_cpu(dip->di_size) & (1ULL << 63))
397 return false; 399 return false;
398 400
399 /* No zero-length symlinks. */ 401 mode = be16_to_cpu(dip->di_mode);
400 if (S_ISLNK(be16_to_cpu(dip->di_mode)) && dip->di_size == 0) 402 if (mode && xfs_mode_to_ftype(mode) == XFS_DIR3_FT_UNKNOWN)
403 return false;
404
405 /* No zero-length symlinks/dirs. */
406 if ((S_ISLNK(mode) || S_ISDIR(mode)) && dip->di_size == 0)
401 return false; 407 return false;
402 408
403 /* only version 3 or greater inodes are extensively verified here */ 409 /* only version 3 or greater inodes are extensively verified here */