Skip to content
Commit c5ca7c76 authored by Theodore Ts'o's avatar Theodore Ts'o
Browse files

ext4: Fallback to vmalloc if kmalloc can't allocate s_flex_groups array



For very large filesystems, the s_flex_groups array can get quite big.
For example, a filesystem that can be resized up to 16TB will have
8192 flex groups (assuming the default flex_bg size of 16), so the
array is 96k, which is *very* marginal for kmalloc().  On the other
hand, a 160GB filesystem without the resize_inode feature will only
require 960 bytes.  So we try to allocate the array first using
kmalloc(), and if that fails, we'll try to use vmalloc() instead.

Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 29fa89d0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment