diff options
| author | 2016-12-07 17:42:30 +1100 | |
|---|---|---|
| committer | 2016-12-07 17:42:30 +1100 | |
| commit | a444d72e609062a040ed95a50e8fccfa1d58281b (patch) | |
| tree | c57054f0e2674a9a80097e48a266c505c0cddca6 /fs/xfs/libxfs/xfs_inode_buf.c | |
| parent | Merge branch 'iomap-4.10-directio' into for-next (diff) | |
| parent | xfs: use rhashtable to track buffer cache (diff) | |
| download | linux-dev-a444d72e609062a040ed95a50e8fccfa1d58281b.tar.xz linux-dev-a444d72e609062a040ed95a50e8fccfa1d58281b.zip | |
Merge branch 'xfs-4.10-misc-fixes-3' into for-next
Diffstat (limited to 'fs/xfs/libxfs/xfs_inode_buf.c')
| -rw-r--r-- | fs/xfs/libxfs/xfs_inode_buf.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 54817f82212c..dd483e2767f7 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -392,6 +392,14 @@ xfs_dinode_verify( if (dip->di_magic != cpu_to_be16(XFS_DINODE_MAGIC)) return false; + /* don't allow invalid i_size */ + if (be64_to_cpu(dip->di_size) & (1ULL << 63)) + return false; + + /* No zero-length symlinks. */ + if (S_ISLNK(be16_to_cpu(dip->di_mode)) && dip->di_size == 0) + return false; + /* only version 3 or greater inodes are extensively verified here */ if (dip->di_version < 3) return true; @@ -436,7 +444,7 @@ xfs_dinode_calc_crc( return; ASSERT(xfs_sb_version_hascrc(&mp->m_sb)); - crc = xfs_start_cksum((char *)dip, mp->m_sb.sb_inodesize, + crc = xfs_start_cksum_update((char *)dip, mp->m_sb.sb_inodesize, XFS_DINODE_CRC_OFF); dip->di_crc = xfs_end_cksum(crc); } |
