-
James Bottomley authored
When mmap MAP_SHARED is done on a file, it gets marked with VM_MAYSHARE and, if it's read/write, VM_SHARED. However, if it is remapped with mremap(), the MAP_SHARED is only passed into the new mapping based on VM_SHARED. This means that remapped read only MAP_SHARED mappings lose VM_MAYSHARE. This is causing us a problem on parisc because we have to align all shared mappings carefully to mitigate cache aliasing problems. The fix is to key passing the MAP_SHARED flag back into the remapped are off VM_MAYSHARE not VM_SHARED.
31412915