Subject: Re: new mremap(2): relax alignment restrictions?
To: None <tech-kern@netbsd.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: tech-kern
Date: 07/30/2007 16:19:12
On Mon, Jul 30, 2007 at 04:06:04PM +0200, Simon 'corecode' Schubert wrote:
> Joerg Sonnenberger wrote:
> >>I'd say the problem is even worse for partially mapped pages in the 
> >>middle of a file.  I.e. map 10 bytes of a 100k file, write to byte 11.
> >
> >In that case the fragment will be expanded to a full block on write
> >back.
> 
> Yes, and the "overflown" buffer will be written to disk.  I'm just pointing 
> out that this "problem" is not limited to "writing behind the file end", 
> but in general "writing behind the map end".

The difference here is that the "overflow" belongs to the file.
Fragments / holes are an implementation detail of the file system and
beside the disk space usage, nothing changes when disabling them.

Joerg