aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 14:53:39 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 14:53:39 -0500
commit958b7f37ee0fb2846c8d44310a68ae9605614ff9 (patch)
treeb1644d08d2e2a8d408c66c6d21a89fd815e16015 /fs/xfs/xfs_inode.c
parentd68798374bcf5cd4a19105b86d96121651b3c8cb (diff)
parente7ff6aed8761b2c86cd9ab7083e512de2b8cfa48 (diff)
Merge git://oss.sgi.com:8090/xfs/xfs-2.6
* git://oss.sgi.com:8090/xfs/xfs-2.6: (33 commits) [XFS] Don't use kmap in xfs_iozero. [XFS] Remove a bunch of unused functions from XFS. [XFS] Remove unused arguments from the XFS_BTREE_*_ADDR macros. [XFS] Remove unused header files for MAC and CAP checking functionality. [XFS] Make freeze code a little cleaner. [XFS] Remove unused argument to xfs_bmap_finish [XFS] Clean up use of VFS attr flags [XFS] Remove useless memory barrier [XFS] XFS sysctl cleanups [XFS] Fix assertion in xfs_attr_shortform_remove(). [XFS] Fix callers of xfs_iozero() to zero the correct range. [XFS] Ensure a frozen filesystem has a clean log before writing the dummy [XFS] Fix sub-block zeroing for buffered writes into unwritten extents. [XFS] Re-initialize the per-cpu superblock counters after recovery. [XFS] Fix block reservation changes for non-SMP systems. [XFS] Fix block reservation mechanism. [XFS] Make growfs work for amounts greater than 2TB [XFS] Fix inode log item use-after-free on forced shutdown [XFS] Fix attr2 corruption with btree data extents [XFS] Workaround log space issue by increasing XFS_TRANS_PUSH_AIL_RESTARTS ...
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r--fs/xfs/xfs_inode.c30
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
2128static __inline__ int xfs_inode_clean(xfs_inode_t *ip) 2126STATIC_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);