Pārlūkot izejas kodu

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>
Yehuda Sadeh 15 gadi atpakaļ
vecāks
revīzija
dbd646a851
1 mainītis faili ar 6 papildinājumiem un 1 dzēšanām
  1. 6 1
      fs/ceph/addr.c

+ 6 - 1
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;
 }