diff options
author | Li zeming <zeming@nfschina.com> | 2022-10-26 03:36:11 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-12-05 18:00:57 +0100 |
commit | 9f0eac070d23405f18e7a84820bc3d59b1415bec (patch) | |
tree | dbef106734cbd1bf5af32fa612fc32ea6399bc63 /fs/btrfs/volumes.c | |
parent | btrfs: use btrfs_dev_name() helper to handle missing devices better (diff) | |
download | linux-9f0eac070d23405f18e7a84820bc3d59b1415bec.tar.xz linux-9f0eac070d23405f18e7a84820bc3d59b1415bec.zip |
btrfs: allocate btrfs_io_context without GFP_NOFAIL
The __GFP_NOFAIL flag could loop indefinitely when allocation memory in
alloc_btrfs_io_context. The callers starting from __btrfs_map_block
already handle errors so it's safe to drop the flag.
Signed-off-by: Li zeming <zeming@nfschina.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 2d0950a17f48..e51fd5f1042a 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -5899,7 +5899,10 @@ static struct btrfs_io_context *alloc_btrfs_io_context(struct btrfs_fs_info *fs_ * and the stripes. */ sizeof(u64) * (total_stripes), - GFP_NOFS|__GFP_NOFAIL); + GFP_NOFS); + + if (!bioc) + return NULL; refcount_set(&bioc->refs, 1); |