From: Mel Gorman Date: Wed, 28 Sep 2011 00:50:06 +0000 (+1000) Subject: ext4: warn if direct reclaim tries to writeback pages X-Git-Tag: next-20110930~1^2~183 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=dc075ebfff34b147508075fc9f2fdbdf79a6ccc6;p=karo-tx-linux.git ext4: warn if direct reclaim tries to writeback pages Direct reclaim should never writeback pages. Warn if an attempt is made. Signed-off-by: Mel Gorman Cc: Dave Chinner Cc: Christoph Hellwig Cc: Johannes Weiner Cc: Wu Fengguang Cc: Jan Kara Cc: Minchan Kim Cc: Rik van Riel Cc: Mel Gorman Cc: Alex Elder Cc: Theodore Ts'o Cc: Chris Mason Cc: Dave Hansen Signed-off-by: Andrew Morton <> --- diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 986e2388f031..0defe0bfe019 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1811,8 +1811,12 @@ static int ext4_writepage(struct page *page, * We don't want to do block allocation, so redirty * the page and return. We may reach here when we do * a journal commit via journal_submit_inode_data_buffers. - * We can also reach here via shrink_page_list + * We can also reach here via shrink_page_list but it + * should never be for direct reclaim so warn if that + * happens */ + WARN_ON_ONCE((current->flags & (PF_MEMALLOC|PF_KSWAPD)) == + PF_MEMALLOC); goto redirty_page; } if (commit_write)