geesefs-0-30-9
Aaron Jacobs 2015-03-23 12:28:13 +11:00
parent 5908a93101
commit 64d7bf8a69
2 changed files with 12 additions and 4 deletions

View File

@ -244,7 +244,9 @@ type FileSystem interface {
//
// Note that one potentially significant case where this is *not* called is
// munmap(2). (Cf. http://goo.gl/7n1r9X, fuse-devel mailing list thread from
// Han-Wen Nienhuys on 2014-10-08.)
// Han-Wen Nienhuys on 2014-10-08.) Even if users close(2) after writing to
// an mmap'd file, on OS X the contents are not immediately flushed (cf.
// https://github.com/osxfuse/osxfuse/issues/202).
//
// Because of cases like dup2(2), calls to FlushFile are not necessarily one
// to one with calls to OpenFile. They should not be used for reference

View File

@ -614,13 +614,19 @@ func (t *FlushFSTest) Mmap_MunmapBeforeClose() {
ExpectThat(t.getFlushes(), ElementsAre())
ExpectThat(t.getFsyncs(), ElementsAre())
// Close the file. We should see a flush.
// Close the file. We should see a flush. On Darwin, this will contain out of
// date contents (cf. https://github.com/osxfuse/osxfuse/issues/202).
err = t.f1.Close()
t.f1 = nil
AssertEq(nil, err)
AssertThat(t.getFlushes(), ElementsAre("paco"))
AssertThat(t.getFsyncs(), ElementsAre())
if runtime.GOOS == "darwin" {
ExpectThat(t.getFlushes(), ElementsAre("taco"))
ExpectThat(t.getFsyncs(), ElementsAre())
} else {
ExpectThat(t.getFlushes(), ElementsAre("paco"))
ExpectThat(t.getFsyncs(), ElementsAre())
}
}
func (t *FlushFSTest) Mmap_CloseBeforeMunmap() {