Dirty pages weren't being written back when an mmap'ed eCryptfs file was
closed before the mapping was unmapped. Since f_ops->flush() is not
called by the munmap() path, the lower file was simply being released.
This patch flushes the eCryptfs file in the vm_ops->close() path.
This is the upstream commit applied to ubuntu-oneiric/master-next. Linus wasn't
entirely happy with the patch, but he did take it in. I agree with his
criticism of the patch but this is a minimal fix to a critical bug and
implementing his suggestions will take a little more time.
I've been testing the patch (and using it daily) over the last week and have
had 0 issues.