fs: don't use igrab() while holding i_lock
authorDave Chinner <dchinner@redhat.com>
Tue, 29 Mar 2011 07:08:50 +0000 (18:08 +1100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 Mar 2011 14:50:34 +0000 (07:50 -0700)
commit0444d76ae64fffc7851797fc1b6ebdbb44ac504a
treed0678f0f8c82f3c2b2c66a6b47242eef1b323142
parentcb1817b37313b4b6c7f8f93c730553dd3cb6ac57
fs: don't use igrab() while holding i_lock

Fix the incorrect use of igrab() inside the i_lock in NFS and Ceph‥

If we are already holding the i_lock, we have a reference to the
inode so we can safely use ihold() to gain an extra reference. This
avoids hangs due to lock recursion on the i_lock now that the
inode_lock is gone and igrab() uses the i_lock itself.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Cc: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ceph/addr.c
fs/ceph/snap.c
fs/nfs/nfs4state.c