Skip to content

Commit e7151e2

Browse files
author
Mikulas Patocka
committed
dm-integrity: allocate the recalculate buffer with kmalloc
Allocate the recalculate buffer with kmalloc rather than vmalloc. This will be needed later, for the simplification of the asynchronous hash interface. Signed-off-by: Mikulas Patocka <[email protected]>
1 parent 4b9197e commit e7151e2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/md/dm-integrity.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2998,7 +2998,7 @@ static void integrity_recalc(struct work_struct *w)
29982998
unsigned recalc_sectors = RECALC_SECTORS;
29992999

30003000
retry:
3001-
recalc_buffer = __vmalloc(recalc_sectors << SECTOR_SHIFT, GFP_NOIO);
3001+
recalc_buffer = kmalloc(recalc_sectors << SECTOR_SHIFT, GFP_NOIO | __GFP_NOWARN);
30023002
if (!recalc_buffer) {
30033003
oom:
30043004
recalc_sectors >>= 1;
@@ -3012,7 +3012,7 @@ static void integrity_recalc(struct work_struct *w)
30123012
recalc_tags_size += ic->internal_hash_digestsize - ic->tag_size;
30133013
recalc_tags = kvmalloc(recalc_tags_size, GFP_NOIO);
30143014
if (!recalc_tags) {
3015-
vfree(recalc_buffer);
3015+
kfree(recalc_buffer);
30163016
recalc_buffer = NULL;
30173017
goto oom;
30183018
}
@@ -3078,7 +3078,7 @@ static void integrity_recalc(struct work_struct *w)
30783078
goto err;
30793079

30803080
io_req.bi_opf = REQ_OP_READ;
3081-
io_req.mem.type = DM_IO_VMA;
3081+
io_req.mem.type = DM_IO_KMEM;
30823082
io_req.mem.ptr.addr = recalc_buffer;
30833083
io_req.notify.fn = NULL;
30843084
io_req.client = ic->io;
@@ -3136,7 +3136,7 @@ static void integrity_recalc(struct work_struct *w)
31363136
recalc_write_super(ic);
31373137

31383138
free_ret:
3139-
vfree(recalc_buffer);
3139+
kfree(recalc_buffer);
31403140
kvfree(recalc_tags);
31413141
}
31423142

0 commit comments

Comments
 (0)