Re: [PATCH v2 1/2] msync: support syncing a small part of the file

From: Andrew Morton
Date: Fri Jun 22 2012 - 17:12:49 EST


On Fri, 15 Jun 2012 17:12:58 +0200
Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:

> msync does not need to flush changes to the entire file, even with MS_SYNC.
> Instead, it can use vfs_fsync_range to only synchronize a part of the file.
> This is part of the specification; expecting msync to synchronize all the
> file would take a very creative interpretation of the manual page as well
> as the specification.
>
> In addition, not all metadata has to be synced; msync is closer to
> fdatasync than it is to fsync. So, pass 1 to vfs_fsync_range.

I renamed the patch to "msync: switch to syncing only the affected part
of the file" to emphasise that there is a behavioural change here.

Then I deleted the patch.

Please recall my thus-far-utterly-and-irritatingly-ignored comments
about nonlinear mappings. Presently an msync() on a nonlinear mapping
will work correctly, because we sync the whole file, yes? And with
this change, we will no longer sync all the pages which were covered by
the affected memory range. Thus breaking the syscall?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/