|
@@ -761,6 +761,16 @@ build_map_info(struct address_space *mapping, loff_t offset, bool is_register)
|
|
|
if (!valid_vma(vma, is_register))
|
|
|
continue;
|
|
|
|
|
|
+ if (!prev && !more) {
|
|
|
+ /*
|
|
|
+ * Needs GFP_NOWAIT to avoid i_mmap_mutex recursion through
|
|
|
+ * reclaim. This is optimistic, no harm done if it fails.
|
|
|
+ */
|
|
|
+ prev = kmalloc(sizeof(struct map_info),
|
|
|
+ GFP_NOWAIT | __GFP_NOMEMALLOC | __GFP_NOWARN);
|
|
|
+ if (prev)
|
|
|
+ prev->next = NULL;
|
|
|
+ }
|
|
|
if (!prev) {
|
|
|
more++;
|
|
|
continue;
|