Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294635
b: refs/heads/master
c: f30d500
h: refs/heads/master
i:
  294633: 34ffb1b
  294631: 994263f
v: v3
  • Loading branch information
Dave Chinner authored and Ben Myers committed Mar 15, 2012
1 parent 3ab9b45 commit c08ca9e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 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: 8d2a5e6ee37f205b3d76c223d4f3f88ba1d06220
refs/heads/master: f30d500f809eca67a21704347ab14bb35877b5ee
18 changes: 12 additions & 6 deletions trunk/fs/xfs/xfs_iget.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,21 +349,27 @@ xfs_iget_cache_miss(
BUG();
}

spin_lock(&pag->pag_ici_lock);
/*
* These values must be set before inserting the inode into the radix
* tree as the moment it is inserted a concurrent lookup (allowed by the
* RCU locking mechanism) can find it and that lookup must see that this
* is an inode currently under construction (i.e. that XFS_INEW is set).
* The ip->i_flags_lock that protects the XFS_INEW flag forms the
* memory barrier that ensures this detection works correctly at lookup
* time.
*/
ip->i_udquot = ip->i_gdquot = NULL;
xfs_iflags_set(ip, XFS_INEW);

/* insert the new inode */
spin_lock(&pag->pag_ici_lock);
error = radix_tree_insert(&pag->pag_ici_root, agino, ip);
if (unlikely(error)) {
WARN_ON(error != -EEXIST);
XFS_STATS_INC(xs_ig_dup);
error = EAGAIN;
goto out_preload_end;
}

/* These values _must_ be set before releasing the radix tree lock! */
ip->i_udquot = ip->i_gdquot = NULL;
xfs_iflags_set(ip, XFS_INEW);

spin_unlock(&pag->pag_ici_lock);
radix_tree_preload_end();

Expand Down

0 comments on commit c08ca9e

Please sign in to comment.