OSDN Git Service

btrfs: raid56: Remove VLA usage
authorKees Cook <keescook@chromium.org>
Tue, 29 May 2018 23:44:59 +0000 (16:44 -0700)
committerDavid Sterba <dsterba@suse.com>
Wed, 30 May 2018 15:15:43 +0000 (17:15 +0200)
commit1389053e1bed93b75b0c3cd292f61032334c81b3
tree71087216205118034caf293b8bf84090bc791bac
parent090a127afa8f73e9618d4058d6755f7ec7453dd6
btrfs: raid56: Remove VLA usage

In the quest to remove all stack VLA usage from the kernel[1], this
allocates the working buffers during regular init, instead of using stack
space. This refactors the allocation code a bit to make it easier
to review.

[1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/raid56.c