]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Direct reclaim should never writeback pages. Warn if an attempt is made.
authorMel Gorman <mgorman@suse.de>
Wed, 24 Aug 2011 23:47:00 +0000 (09:47 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 20 Sep 2011 07:07:33 +0000 (17:07 +1000)
Signed-off-by: Mel Gorman <mgorman@suse.de>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Johannes Weiner <jweiner@redhat.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Alex Elder <aelder@sgi.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ext4/inode.c

index 99df282195c40083c065f50ca403fe950abe87ed..cc6cc9ad297f2c37052f2bdf5f9825e76ba44c23 100644 (file)
@@ -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)