From: Kent Overstreet Date: Wed, 27 May 2020 18:10:27 +0000 (-0400) Subject: bcachefs: fix memalloc_nofs_restore() usage X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=692c3f0601bd1b04b914a40907a36e4c36dc8edd;p=linux.git bcachefs: fix memalloc_nofs_restore() usage Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/btree_cache.c b/fs/bcachefs/btree_cache.c index 4ff57925fb2cc..ef7ca552a0a38 100644 --- a/fs/bcachefs/btree_cache.c +++ b/fs/bcachefs/btree_cache.c @@ -554,7 +554,6 @@ out_unlock: list_del_init(&b->list); mutex_unlock(&bc->lock); - memalloc_nofs_restore(flags); out: b->flags = 0; b->written = 0; @@ -567,6 +566,7 @@ out: bch2_time_stats_update(&c->times[BCH_TIME_btree_node_mem_alloc], start_time); + memalloc_nofs_restore(flags); return b; err: /* Try to cannibalize another cached btree node: */ @@ -582,6 +582,7 @@ err: } mutex_unlock(&bc->lock); + memalloc_nofs_restore(flags); return ERR_PTR(-ENOMEM); }