diff options
Diffstat (limited to 'fs/xfs/xfs_iget.c')
-rw-r--r-- | fs/xfs/xfs_iget.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index e2fb6210d4c5..478e587087fe 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c | |||
@@ -246,9 +246,6 @@ xfs_iget_cache_miss( | |||
246 | goto out_destroy; | 246 | goto out_destroy; |
247 | } | 247 | } |
248 | 248 | ||
249 | if (lock_flags) | ||
250 | xfs_ilock(ip, lock_flags); | ||
251 | |||
252 | /* | 249 | /* |
253 | * Preload the radix tree so we can insert safely under the | 250 | * Preload the radix tree so we can insert safely under the |
254 | * write spinlock. Note that we cannot sleep inside the preload | 251 | * write spinlock. Note that we cannot sleep inside the preload |
@@ -256,7 +253,16 @@ xfs_iget_cache_miss( | |||
256 | */ | 253 | */ |
257 | if (radix_tree_preload(GFP_KERNEL)) { | 254 | if (radix_tree_preload(GFP_KERNEL)) { |
258 | error = EAGAIN; | 255 | error = EAGAIN; |
259 | goto out_unlock; | 256 | goto out_destroy; |
257 | } | ||
258 | |||
259 | /* | ||
260 | * Because the inode hasn't been added to the radix-tree yet it can't | ||
261 | * be found by another thread, so we can do the non-sleeping lock here. | ||
262 | */ | ||
263 | if (lock_flags) { | ||
264 | if (!xfs_ilock_nowait(ip, lock_flags)) | ||
265 | BUG(); | ||
260 | } | 266 | } |
261 | 267 | ||
262 | mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1); | 268 | mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1); |
@@ -284,7 +290,6 @@ xfs_iget_cache_miss( | |||
284 | out_preload_end: | 290 | out_preload_end: |
285 | write_unlock(&pag->pag_ici_lock); | 291 | write_unlock(&pag->pag_ici_lock); |
286 | radix_tree_preload_end(); | 292 | radix_tree_preload_end(); |
287 | out_unlock: | ||
288 | if (lock_flags) | 293 | if (lock_flags) |
289 | xfs_iunlock(ip, lock_flags); | 294 | xfs_iunlock(ip, lock_flags); |
290 | out_destroy: | 295 | out_destroy: |