bcachefs: Use kvmalloc() for array of sorted keys in journal replay
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 3 Jan 2022 09:17:02 +0000 (04:17 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:21 +0000 (17:09 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/recovery.c

index cb0ba84..e4ba3f0 100644 (file)
@@ -519,7 +519,7 @@ static int bch2_journal_replay(struct bch_fs *c)
        size_t i;
        int ret;
 
-       keys_sorted = kmalloc_array(sizeof(*keys_sorted), keys->nr, GFP_KERNEL);
+       keys_sorted = kvmalloc_array(sizeof(*keys_sorted), keys->nr, GFP_KERNEL);
        if (!keys_sorted)
                return -ENOMEM;
 
@@ -563,7 +563,7 @@ static int bch2_journal_replay(struct bch_fs *c)
        bch2_journal_flush_all_pins(j);
        ret = bch2_journal_error(j);
 err:
-       kfree(keys_sorted);
+       kvfree(keys_sorted);
        return ret;
 }