From: Yehuda Sadeh Date: Wed, 16 Dec 2009 22:51:06 +0000 (-0800) Subject: ceph: writepage grabs and releases inode X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dbd646a851713bec5bfff40ecf624b2e78518fe5;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 --- 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; }