diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-07-20 13:00:15 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:42 -0400 |
commit | e8306e3b4ca2d6cb325136afe5631247466ad176 (patch) | |
tree | bf33fc62b48fd990d949dca936b775d460cf2ebb /fs/bcachefs/compress.c | |
parent | f621e1521c3ff5ea295a97d7d71cdbe84f496467 (diff) | |
download | linux-e8306e3b4ca2d6cb325136afe5631247466ad176.tar.gz linux-e8306e3b4ca2d6cb325136afe5631247466ad176.tar.bz2 linux-e8306e3b4ca2d6cb325136afe5631247466ad176.zip |
bcachefs: Wrap write path in memalloc_nofs_save()
This fixes a lockdep splat where we're allocating memory with vmalloc in
the compression bounce path, which doesn't always obey GFP_NOFS.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/compress.c')
-rw-r--r-- | fs/bcachefs/compress.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/bcachefs/compress.c b/fs/bcachefs/compress.c index 920460a182b4..595d76aa3956 100644 --- a/fs/bcachefs/compress.c +++ b/fs/bcachefs/compress.c @@ -7,7 +7,6 @@ #include "super-io.h" #include <linux/lz4.h> -#include <linux/sched/mm.h> #include <linux/zlib.h> #include <linux/zstd.h> @@ -64,7 +63,7 @@ static struct bbuf __bio_map_or_bounce(struct bch_fs *c, struct bio *bio, struct bbuf ret; struct bio_vec bv; struct bvec_iter iter; - unsigned nr_pages = 0, flags; + unsigned nr_pages = 0; struct page *stack_pages[16]; struct page **pages = NULL; void *data; @@ -104,10 +103,7 @@ static struct bbuf __bio_map_or_bounce(struct bch_fs *c, struct bio *bio, __bio_for_each_segment(bv, bio, iter, start) pages[nr_pages++] = bv.bv_page; - flags = memalloc_nofs_save(); data = vmap(pages, nr_pages, VM_MAP, PAGE_KERNEL); - memalloc_nofs_restore(flags); - if (pages != stack_pages) kfree(pages); |