Re: mmap()'d file contents disappear

Linus Torvalds (torvalds@cs.helsinki.fi)
Sat, 27 Apr 1996 12:31:59 +0300 (EET DST)


On Fri, 26 Apr 1996, TANAKA Yoshitomo wrote:
>
> I am confused by mmap()'d file contents disappearance.

Thank you for the very nice explanation on when you see the file mmap
info disappearing: this was a rather subtle bug..

It _should_ be fixed with this very simple patch:

In the file linux/mm/filemap.c, function filemap_sync(), there is a line
that says:

dir = pgd_offset(current->mm, address);

but it should be

dir = pgd_offset(vma->vm_mm, address);

(ie change "current->mm" into "vma->vm_mm"). Does that fix the problem
for you?

Linus