summaryrefslogtreecommitdiffstats
path: root/fs/ceph/addr.c
diff options
context:
space:
mode:
authorDave Chinner2011-03-29 09:08:50 +0200
committerLinus Torvalds2011-03-29 16:50:34 +0200
commit0444d76ae64fffc7851797fc1b6ebdbb44ac504a (patch)
treed0678f0f8c82f3c2b2c66a6b47242eef1b323142 /fs/ceph/addr.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 (diff)
downloadkernel-qcow2-linux-0444d76ae64fffc7851797fc1b6ebdbb44ac504a.tar.gz
kernel-qcow2-linux-0444d76ae64fffc7851797fc1b6ebdbb44ac504a.tar.xz
kernel-qcow2-linux-0444d76ae64fffc7851797fc1b6ebdbb44ac504a.zip
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>
Diffstat (limited to 'fs/ceph/addr.c')
-rw-r--r--fs/ceph/addr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 561438b6a50c..37368ba2e67c 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -92,7 +92,7 @@ static int ceph_set_page_dirty(struct page *page)
ci->i_head_snapc = ceph_get_snap_context(snapc);
++ci->i_wrbuffer_ref_head;
if (ci->i_wrbuffer_ref == 0)
- igrab(inode);
+ ihold(inode);
++ci->i_wrbuffer_ref;
dout("%p set_page_dirty %p idx %lu head %d/%d -> %d/%d "
"snapc %p seq %lld (%d snaps)\n",