Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143172
b: refs/heads/master
c: 705db3f
h: refs/heads/master
v: v3
  • Loading branch information
Dave Chinner authored and Christoph Hellwig committed Apr 6, 2009
1 parent cbcee44 commit 4c46cda
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 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: a6cb767e24b1dbedfcfa8077eab0aa2eab224038
refs/heads/master: 705db3fd4660174a27418bbcb874d209a76044eb
23 changes: 14 additions & 9 deletions trunk/fs/xfs/xfs_iget.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,6 @@ xfs_inode_alloc(
ASSERT(!spin_is_locked(&ip->i_flags_lock));
ASSERT(completion_done(&ip->i_flush));

/*
* initialise the VFS inode here to get failures
* out of the way early.
*/
if (!inode_init_always(mp->m_super, VFS_I(ip))) {
kmem_zone_free(xfs_inode_zone, ip);
return NULL;
}

/* initialise the xfs inode */
ip->i_ino = ino;
ip->i_mount = mp;
Expand Down Expand Up @@ -113,6 +104,20 @@ xfs_inode_alloc(
#ifdef XFS_DIR2_TRACE
ip->i_dir_trace = ktrace_alloc(XFS_DIR2_KTRACE_SIZE, KM_NOFS);
#endif
/*
* Now initialise the VFS inode. We do this after the xfs_inode
* initialisation as internal failures will result in ->destroy_inode
* being called and that will pass down through the reclaim path and
* free the XFS inode. This path requires the XFS inode to already be
* initialised. Hence if this call fails, the xfs_inode has already
* been freed and we should not reference it at all in the error
* handling.
*/
if (!inode_init_always(mp->m_super, VFS_I(ip)))
return NULL;

/* prevent anyone from using this yet */
VFS_I(ip)->i_state = I_NEW|I_LOCK;

return ip;
}
Expand Down

0 comments on commit 4c46cda

Please sign in to comment.