Skip to content

Commit

Permalink
ceph: writepage grabs and releases inode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yehuda Sadeh authored and Sage Weil committed Dec 22, 2009
1 parent 169e16c commit dbd646a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,13 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)

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;
}

Expand Down

0 comments on commit dbd646a

Please sign in to comment.