diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-02-11 07:13:10 -0500 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-02-14 13:07:56 -0500 |
commit | 175359f89df39f4faed663c8cfd6ee0222d2fa1e (patch) | |
tree | 8a5da216333192e7c2d605e1644f6bead22cdd06 /fs/reiserfs | |
parent | bbec919150037b8a2e58e32d3ba642ba3b6582a5 (diff) |
reiserfs: Fix softlockup while waiting on an inode
When we wait for an inode through reiserfs_iget(), we hold
the reiserfs lock. And waiting for an inode may imply waiting
for its writeback. But the inode writeback path may also require
the reiserfs lock, which leads to a deadlock.
We just need to release the reiserfs lock from reiserfs_iget()
to fix this.
Reported-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Tested-by: Christian Kujau <lists@nerdbynature.de>
Cc: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r-- | fs/reiserfs/inode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 9087b10209e6..2df0f5c7c60b 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -1497,9 +1497,11 @@ struct inode *reiserfs_iget(struct super_block *s, const struct cpu_key *key) | |||
1497 | 1497 | ||
1498 | args.objectid = key->on_disk_key.k_objectid; | 1498 | args.objectid = key->on_disk_key.k_objectid; |
1499 | args.dirid = key->on_disk_key.k_dir_id; | 1499 | args.dirid = key->on_disk_key.k_dir_id; |
1500 | reiserfs_write_unlock(s); | ||
1500 | inode = iget5_locked(s, key->on_disk_key.k_objectid, | 1501 | inode = iget5_locked(s, key->on_disk_key.k_objectid, |
1501 | reiserfs_find_actor, reiserfs_init_locked_inode, | 1502 | reiserfs_find_actor, reiserfs_init_locked_inode, |
1502 | (void *)(&args)); | 1503 | (void *)(&args)); |
1504 | reiserfs_write_lock(s); | ||
1503 | if (!inode) | 1505 | if (!inode) |
1504 | return ERR_PTR(-ENOMEM); | 1506 | return ERR_PTR(-ENOMEM); |
1505 | 1507 | ||