Skip to content

Commit dbd646a

Browse files
Yehuda Sadehliewegas
authored andcommitted
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>
1 parent 169e16c commit dbd646a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎fs/ceph/addr.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,13 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
448448

449449
static int ceph_writepage(struct page *page, struct writeback_control *wbc)
450450
{
451-
int err = writepage_nounlock(page, wbc);
451+
int err;
452+
struct inode *inode = page->mapping->host;
453+
BUG_ON(!inode);
454+
igrab(inode);
455+
err = writepage_nounlock(page, wbc);
452456
unlock_page(page);
457+
iput(inode);
453458
return err;
454459
}
455460

0 commit comments

Comments
 (0)