diff options
Diffstat (limited to 'fs/xfs/xfs_inode.c')
| -rw-r--r-- | fs/xfs/xfs_inode.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 44dfac521285..3da9829c19d5 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
| @@ -47,7 +47,6 @@ | |||
| 47 | #include "xfs_utils.h" | 47 | #include "xfs_utils.h" |
| 48 | #include "xfs_dir2_trace.h" | 48 | #include "xfs_dir2_trace.h" |
| 49 | #include "xfs_quota.h" | 49 | #include "xfs_quota.h" |
| 50 | #include "xfs_mac.h" | ||
| 51 | #include "xfs_acl.h" | 50 | #include "xfs_acl.h" |
| 52 | 51 | ||
| 53 | 52 | ||
| @@ -1699,8 +1698,7 @@ xfs_itruncate_finish( | |||
| 1699 | * Duplicate the transaction that has the permanent | 1698 | * Duplicate the transaction that has the permanent |
| 1700 | * reservation and commit the old transaction. | 1699 | * reservation and commit the old transaction. |
| 1701 | */ | 1700 | */ |
| 1702 | error = xfs_bmap_finish(tp, &free_list, first_block, | 1701 | error = xfs_bmap_finish(tp, &free_list, &committed); |
| 1703 | &committed); | ||
| 1704 | ntp = *tp; | 1702 | ntp = *tp; |
| 1705 | if (error) { | 1703 | if (error) { |
| 1706 | /* | 1704 | /* |
| @@ -1810,7 +1808,7 @@ xfs_igrow_start( | |||
| 1810 | * and any blocks between the old and new file sizes. | 1808 | * and any blocks between the old and new file sizes. |
| 1811 | */ | 1809 | */ |
| 1812 | error = xfs_zero_eof(XFS_ITOV(ip), &ip->i_iocore, new_size, | 1810 | error = xfs_zero_eof(XFS_ITOV(ip), &ip->i_iocore, new_size, |
| 1813 | ip->i_d.di_size, new_size); | 1811 | ip->i_d.di_size); |
| 1814 | return error; | 1812 | return error; |
| 1815 | } | 1813 | } |
| 1816 | 1814 | ||
| @@ -2125,7 +2123,7 @@ xfs_iunlink_remove( | |||
| 2125 | return 0; | 2123 | return 0; |
| 2126 | } | 2124 | } |
| 2127 | 2125 | ||
| 2128 | static __inline__ int xfs_inode_clean(xfs_inode_t *ip) | 2126 | STATIC_INLINE int xfs_inode_clean(xfs_inode_t *ip) |
| 2129 | { | 2127 | { |
| 2130 | return (((ip->i_itemp == NULL) || | 2128 | return (((ip->i_itemp == NULL) || |
| 2131 | !(ip->i_itemp->ili_format.ilf_fields & XFS_ILOG_ALL)) && | 2129 | !(ip->i_itemp->ili_format.ilf_fields & XFS_ILOG_ALL)) && |
| @@ -2707,10 +2705,24 @@ xfs_idestroy( | |||
| 2707 | ktrace_free(ip->i_dir_trace); | 2705 | ktrace_free(ip->i_dir_trace); |
| 2708 | #endif | 2706 | #endif |
| 2709 | if (ip->i_itemp) { | 2707 | if (ip->i_itemp) { |
| 2710 | /* XXXdpd should be able to assert this but shutdown | 2708 | /* |
| 2711 | * is leaving the AIL behind. */ | 2709 | * Only if we are shutting down the fs will we see an |
| 2712 | ASSERT(((ip->i_itemp->ili_item.li_flags & XFS_LI_IN_AIL) == 0) || | 2710 | * inode still in the AIL. If it is there, we should remove |
| 2713 | XFS_FORCED_SHUTDOWN(ip->i_mount)); | 2711 | * it to prevent a use-after-free from occurring. |
| 2712 | */ | ||
| 2713 | xfs_mount_t *mp = ip->i_mount; | ||
| 2714 | xfs_log_item_t *lip = &ip->i_itemp->ili_item; | ||
| 2715 | int s; | ||
| 2716 | |||
| 2717 | ASSERT(((lip->li_flags & XFS_LI_IN_AIL) == 0) || | ||
| 2718 | XFS_FORCED_SHUTDOWN(ip->i_mount)); | ||
| 2719 | if (lip->li_flags & XFS_LI_IN_AIL) { | ||
| 2720 | AIL_LOCK(mp, s); | ||
| 2721 | if (lip->li_flags & XFS_LI_IN_AIL) | ||
| 2722 | xfs_trans_delete_ail(mp, lip, s); | ||
| 2723 | else | ||
| 2724 | AIL_UNLOCK(mp, s); | ||
| 2725 | } | ||
| 2714 | xfs_inode_item_destroy(ip); | 2726 | xfs_inode_item_destroy(ip); |
| 2715 | } | 2727 | } |
| 2716 | kmem_zone_free(xfs_inode_zone, ip); | 2728 | kmem_zone_free(xfs_inode_zone, ip); |
