Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47848
b: refs/heads/master
c: f74eaf5
h: refs/heads/master
v: v3
  • Loading branch information
David Chinner authored and Tim Shimmin committed Feb 10, 2007
1 parent 45d8d1e commit 8c7f3b5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e5889e90dda328443161e9512f1123c9814d03de
refs/heads/master: f74eaf59b36c0ad01f416b567f89c737bbf82bae
22 changes: 18 additions & 4 deletions trunk/fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2707,10 +2707,24 @@ xfs_idestroy(
ktrace_free(ip->i_dir_trace);
#endif
if (ip->i_itemp) {
/* XXXdpd should be able to assert this but shutdown
* is leaving the AIL behind. */
ASSERT(((ip->i_itemp->ili_item.li_flags & XFS_LI_IN_AIL) == 0) ||
XFS_FORCED_SHUTDOWN(ip->i_mount));
/*
* Only if we are shutting down the fs will we see an
* inode still in the AIL. If it is there, we should remove
* it to prevent a use-after-free from occurring.
*/
xfs_mount_t *mp = ip->i_mount;
xfs_log_item_t *lip = &ip->i_itemp->ili_item;
int s;

ASSERT(((lip->li_flags & XFS_LI_IN_AIL) == 0) ||
XFS_FORCED_SHUTDOWN(ip->i_mount));
if (lip->li_flags & XFS_LI_IN_AIL) {
AIL_LOCK(mp, s);
if (lip->li_flags & XFS_LI_IN_AIL)
xfs_trans_delete_ail(mp, lip, s);
else
AIL_UNLOCK(mp, s);
}
xfs_inode_item_destroy(ip);
}
kmem_zone_free(xfs_inode_zone, ip);
Expand Down

0 comments on commit 8c7f3b5

Please sign in to comment.