If try_to_release_page() is called with a zero gfp mask, then theWell I was using mapping_gfp_mask(mapping) as the argument to
filesystem is effectively denied the possibility of sleeping while
attempting to release the page. There doesn't appear to be any valid
reason why this should be banned, given that we're not calling this from
a memory allocation context.
For this reason, change the gfp_mask argument of the call to GFP_KERNEL.
Note: I am less sure of what the callers of invalidate_complete_page()
require, and so this patch does not touch that mask.
Signed-off-by: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
---
diff --git a/mm/truncate.c b/mm/truncate.c
index f4edbc1..49c1ffd 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -302,7 +302,7 @@ invalidate_complete_page2(struct address
if (page->mapping != mapping)
return 0;
- if (PagePrivate(page) && !try_to_release_page(page, 0))
+ if (PagePrivate(page) && !try_to_release_page(page, GFP_KERNEL))
return 0;
write_lock_irq(&mapping->tree_lock);