diff options
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 5a5e035e5d38..e7ae08d1df48 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -424,6 +424,19 @@ xfs_iformat( | |||
424 | case XFS_DINODE_FMT_LOCAL: | 424 | case XFS_DINODE_FMT_LOCAL: |
425 | atp = (xfs_attr_shortform_t *)XFS_DFORK_APTR(dip); | 425 | atp = (xfs_attr_shortform_t *)XFS_DFORK_APTR(dip); |
426 | size = be16_to_cpu(atp->hdr.totsize); | 426 | size = be16_to_cpu(atp->hdr.totsize); |
427 | |||
428 | if (unlikely(size < sizeof(struct xfs_attr_sf_hdr))) { | ||
429 | xfs_fs_repair_cmn_err(CE_WARN, ip->i_mount, | ||
430 | "corrupt inode %Lu " | ||
431 | "(bad attr fork size %Ld).", | ||
432 | (unsigned long long) ip->i_ino, | ||
433 | (long long) size); | ||
434 | XFS_CORRUPTION_ERROR("xfs_iformat(8)", | ||
435 | XFS_ERRLEVEL_LOW, | ||
436 | ip->i_mount, dip); | ||
437 | return XFS_ERROR(EFSCORRUPTED); | ||
438 | } | ||
439 | |||
427 | error = xfs_iformat_local(ip, dip, XFS_ATTR_FORK, size); | 440 | error = xfs_iformat_local(ip, dip, XFS_ATTR_FORK, size); |
428 | break; | 441 | break; |
429 | case XFS_DINODE_FMT_EXTENTS: | 442 | case XFS_DINODE_FMT_EXTENTS: |
@@ -1601,10 +1614,10 @@ xfs_itruncate_finish( | |||
1601 | * in this file with garbage in them once recovery | 1614 | * in this file with garbage in them once recovery |
1602 | * runs. | 1615 | * runs. |
1603 | */ | 1616 | */ |
1604 | XFS_BMAP_INIT(&free_list, &first_block); | 1617 | xfs_bmap_init(&free_list, &first_block); |
1605 | error = xfs_bunmapi(ntp, ip, | 1618 | error = xfs_bunmapi(ntp, ip, |
1606 | first_unmap_block, unmap_len, | 1619 | first_unmap_block, unmap_len, |
1607 | XFS_BMAPI_AFLAG(fork) | | 1620 | xfs_bmapi_aflag(fork) | |
1608 | (sync ? 0 : XFS_BMAPI_ASYNC), | 1621 | (sync ? 0 : XFS_BMAPI_ASYNC), |
1609 | XFS_ITRUNC_MAX_EXTENTS, | 1622 | XFS_ITRUNC_MAX_EXTENTS, |
1610 | &first_block, &free_list, | 1623 | &first_block, &free_list, |
@@ -2557,7 +2570,7 @@ xfs_iextents_copy( | |||
2557 | for (i = 0; i < nrecs; i++) { | 2570 | for (i = 0; i < nrecs; i++) { |
2558 | xfs_bmbt_rec_host_t *ep = xfs_iext_get_ext(ifp, i); | 2571 | xfs_bmbt_rec_host_t *ep = xfs_iext_get_ext(ifp, i); |
2559 | start_block = xfs_bmbt_get_startblock(ep); | 2572 | start_block = xfs_bmbt_get_startblock(ep); |
2560 | if (ISNULLSTARTBLOCK(start_block)) { | 2573 | if (isnullstartblock(start_block)) { |
2561 | /* | 2574 | /* |
2562 | * It's a delayed allocation extent, so skip it. | 2575 | * It's a delayed allocation extent, so skip it. |
2563 | */ | 2576 | */ |