Re: [PATCH] Sync only the requested range in msync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> writes:

> On Wed, 23 Apr 2014 07:11:15 -0700 Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
>> On Thu, Mar 27, 2014 at 07:02:41PM -0400, Matthew Wilcox wrote:
>> > [untested.  posted because it keeps coming up at lsfmm/collab]
>> > 
>> > msync() currently syncs more than POSIX requires or BSD or Solaris
>> > implement.  It is supposed to be equivalent to fdatasync(), not fsync(),
>> > and it is only supposed to sync the portion of the file that overlaps
>> > the range passed to msync.
>> > 
>> > If the VMA is non-linear, fall back to syncing the entire file, but we
>> > still optimise to only fdatasync() the entire file, not the full fsync().
>> > 
>> > Signed-off-by: Matthew Wilcox <matthew.r.wilcox@xxxxxxxxx>
>> 
>> Looks good,
>> 
>> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
>
> I worry that if there are people who are relying on the current
> behaviour (knowingly or not!) then this patch will put their data at
> risk and nobody will ever know.  Until that data gets lost, that is.
> At some level of cautiousness, this is one of those things we can never
> fix.
>
> I suppose we could add an msync2() syscall with the new behaviour so
> people can migrate over.  That would be very cheap to do.
>
> It's hard to know what's the right thing to do here.

FWIW, I think we should apply the patch.  Anyone using the API properly
will not get the desired result, and it could have a negative impact on
performance.  The man page is very explicit on what you should expect,
here.  Anyone relying on undocumented behavior gets to keep both pieces
when it breaks.  That said, I do understand your viewpoint, Andrew,
especially since it's so hard to get people to sync their data at all,
much less correctly.

Acked-by: Jeff Moyer <jmoyer@xxxxxxxxxx>

-Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux