nbd: Respect max_part for all partition scans
[linux-2.6-microblaze.git] / mm / mmap.c
index 886de79..10598e5 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -3422,6 +3422,17 @@ static int special_mapping_mremap(struct vm_area_struct *new_vma,
        return 0;
 }
 
+static int special_mapping_split(struct vm_area_struct *vma, unsigned long addr)
+{
+       /*
+        * Forbid splitting special mappings - kernel has expectations over
+        * the number of pages in mapping. Together with VM_DONTEXPAND
+        * the size of vma should stay the same over the special mapping's
+        * lifetime.
+        */
+       return -EINVAL;
+}
+
 static const struct vm_operations_struct special_mapping_vmops = {
        .close = special_mapping_close,
        .fault = special_mapping_fault,
@@ -3429,6 +3440,7 @@ static const struct vm_operations_struct special_mapping_vmops = {
        .name = special_mapping_name,
        /* vDSO code relies that VVAR can't be accessed remotely */
        .access = NULL,
+       .may_split = special_mapping_split,
 };
 
 static const struct vm_operations_struct legacy_special_mapping_vmops = {