summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorChris Mason2017-05-05 01:08:08 +0200
committerChris Mason2017-05-05 01:56:11 +0200
commit9bcaaea7418d09691f1ffab5c49aacafe3eef9d0 (patch)
treede8fb04851d438df09674e02002e28ce8657af76 /fs/btrfs/disk-io.c
parentMerge branch 'for-chris-4.12' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff)
downloadkernel-qcow2-linux-9bcaaea7418d09691f1ffab5c49aacafe3eef9d0.tar.gz
kernel-qcow2-linux-9bcaaea7418d09691f1ffab5c49aacafe3eef9d0.tar.xz
kernel-qcow2-linux-9bcaaea7418d09691f1ffab5c49aacafe3eef9d0.zip
btrfs: fix the gfp_mask for the reada_zones radix tree
Commits cc8385b59e17 and 7ef70b4d9987a7 added preallocation for the reada radix trees and also switched them over to GFP_KERNEL for the default gfp mask. Since we're doing radix tree insertions under spinlocks, we need to make sure the mask doesn't allow sleeping. This fix keeps the radix preallocation but switches back to the original gfp_mask. Reported-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index ba7bd65693a3..683194242deb 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2693,7 +2693,7 @@ int open_ctree(struct super_block *sb,
fs_info->commit_interval = BTRFS_DEFAULT_COMMIT_INTERVAL;
fs_info->avg_delayed_ref_runtime = NSEC_PER_SEC >> 6; /* div by 64 */
/* readahead state */
- INIT_RADIX_TREE(&fs_info->reada_tree, GFP_KERNEL);
+ INIT_RADIX_TREE(&fs_info->reada_tree, GFP_NOFS & ~__GFP_DIRECT_RECLAIM);
spin_lock_init(&fs_info->reada_lock);
fs_info->thread_pool_size = min_t(unsigned long,