xfs: use GFP_NOFS for page cache allocation
authorDave Chinner <dchinner@redhat.com>
Tue, 20 Jul 2010 07:54:12 +0000 (17:54 +1000)
committerAlex Elder <aelder@sgi.com>
Mon, 26 Jul 2010 18:16:49 +0000 (13:16 -0500)
Avoid a lockdep warning by preventing page cache allocation from
recursing back into the filesystem during memory reclaim.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/linux-2.6/xfs_aops.c

index 225ec0fa65b67517ff2af1139f1e2c86d7cd948a..8abbf0532ea125927e93370dd912f2998bd25d7e 100644 (file)
@@ -1493,8 +1493,8 @@ xfs_vm_write_begin(
        void                    **fsdata)
 {
        *pagep = NULL;
-       return block_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
-                                                               xfs_get_blocks);
+       return block_write_begin(file, mapping, pos, len, flags | AOP_FLAG_NOFS,
+                                pagep, fsdata, xfs_get_blocks);
 }
 
 STATIC sector_t