Skip to content

Commit

Permalink
reiserfs: Fix softlockup while waiting on an inode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Frederic Weisbecker committed Feb 14, 2010
1 parent bbec919 commit 175359f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/reiserfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1497,9 +1497,11 @@ struct inode *reiserfs_iget(struct super_block *s, const struct cpu_key *key)

args.objectid = key->on_disk_key.k_objectid;
args.dirid = key->on_disk_key.k_dir_id;
reiserfs_write_unlock(s);
inode = iget5_locked(s, key->on_disk_key.k_objectid,
reiserfs_find_actor, reiserfs_init_locked_inode,
(void *)(&args));
reiserfs_write_lock(s);
if (!inode)
return ERR_PTR(-ENOMEM);

Expand Down

0 comments on commit 175359f

Please sign in to comment.