diff options
author | Michal Hocko <mhocko@suse.com> | 2017-01-09 15:39:02 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-02-14 15:50:49 +0100 |
commit | 3ba7ab220e8918176c6f38ee09df86150aca1611 (patch) | |
tree | cfc9c4299f03ae428f4ba3ab7bda2ab0e41a0c68 /fs/btrfs/extent_io.c | |
parent | btrfs: Add WARN_ON for qgroup reserved underflow (diff) | |
download | linux-3ba7ab220e8918176c6f38ee09df86150aca1611.tar.xz linux-3ba7ab220e8918176c6f38ee09df86150aca1611.zip |
btrfs: fix up misleading GFP_NOFS usage in btrfs_releasepage
b335b0034e25 ("Btrfs: Avoid using __GFP_HIGHMEM with slab allocator")
has reduced the allocation mask in btrfs_releasepage to GFP_NOFS just
to prevent from giving an unappropriate gfp mask to the slab allocator
deeper down the callchain (in alloc_extent_state). This is wrong for
two reasons a) GFP_NOFS might be just too restrictive for the calling
context b) it is better to tweak the gfp mask down when it needs that.
So just remove the mask tweaking from btrfs_releasepage and move it
down to alloc_extent_state where it is needed.
Signed-off-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 4ac383a3a649..28a5a1534366 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -226,6 +226,11 @@ static struct extent_state *alloc_extent_state(gfp_t mask) { struct extent_state *state; + /* + * The given mask might be not appropriate for the slab allocator, + * drop the unsupported bits + */ + mask &= ~(__GFP_DMA32|__GFP_HIGHMEM); state = kmem_cache_alloc(extent_state_cache, mask); if (!state) return state; |