|
@@ -14,6 +14,7 @@
|
|
|
#include <linux/log2.h>
|
|
|
#include <linux/module.h>
|
|
|
#include <linux/slab.h>
|
|
|
+#include <linux/nospec.h>
|
|
|
#include <linux/backing-dev.h>
|
|
|
#include <trace/events/ext4.h>
|
|
|
|
|
@@ -2140,7 +2141,8 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac)
|
|
|
* This should tell if fe_len is exactly power of 2
|
|
|
*/
|
|
|
if ((ac->ac_g_ex.fe_len & (~(1 << (i - 1)))) == 0)
|
|
|
- ac->ac_2order = i - 1;
|
|
|
+ ac->ac_2order = array_index_nospec(i - 1,
|
|
|
+ sb->s_blocksize_bits + 2);
|
|
|
}
|
|
|
|
|
|
/* if stream allocation is enabled, use global goal */
|