summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@hq.newdream.net>2009-12-16 23:51:06 +0100
committerSage Weil <sage@newdream.net>2009-12-22 01:39:56 +0100
commitdbd646a851713bec5bfff40ecf624b2e78518fe5 (patch)
treee5c4e141b7ec03ed5d2766a6909b1f48a5ec6519
parentceph: remove unaccessible code (diff)
downloadlinux-dbd646a851713bec5bfff40ecf624b2e78518fe5.tar.xz
linux-dbd646a851713bec5bfff40ecf624b2e78518fe5.zip
ceph: writepage grabs and releases inode
Fixes a deadlock that is triggered due to kswapd, while the page was locked and the iput couldn't tear down the address space. Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
-rw-r--r--fs/ceph/addr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index bf535815592d..d0cdceb0b90b 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -448,8 +448,13 @@ out:
static int ceph_writepage(struct page *page, struct writeback_control *wbc)
{
- int err = writepage_nounlock(page, wbc);
+ int err;
+ struct inode *inode = page->mapping->host;
+ BUG_ON(!inode);
+ igrab(inode);
+ err = writepage_nounlock(page, wbc);
unlock_page(page);
+ iput(inode);
return err;
}