Skip to content

Commit 9a4a858

Browse files
author
Kent Overstreet
committed
bcachefs: Use bch2_kvmalloc() for journal keys array
We can hit this limit fairly easy when we have to reconstuct large amounts of alloc info on large filesystems. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent e5a3b8c commit 9a4a858

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/bcachefs/btree_journal_iter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ int bch2_journal_key_insert_take(struct bch_fs *c, enum btree_id id,
288288
.size = max_t(size_t, keys->size, 8) * 2,
289289
};
290290

291-
new_keys.data = kvmalloc_array(new_keys.size, sizeof(new_keys.data[0]), GFP_KERNEL);
291+
new_keys.data = bch2_kvmalloc(new_keys.size * sizeof(new_keys.data[0]), GFP_KERNEL);
292292
if (!new_keys.data) {
293293
bch_err(c, "%s: error allocating new key array (size %zu)",
294294
__func__, new_keys.size);

0 commit comments

Comments
 (0)