Re: [patch 01/22] update ctime and mtime for mmaped write



These change still have the undesirable property that although the
modified pages may be flushed to stable storage, the metadata on
the file will not be updated until the application takes positive
action. This is permissible given the current wording in the
specifications, but it would be much more desirable if sync(2),
fsync(P), or the inode being written out due to normal system
activity would also cause the metadata to be updated.

Perhaps the setting of the flag could be checked in some places
like __sync_single_inode() and do_fsync()?

I don't see the point in updating the timestamp from these functions.

The file isn't _modified_ by sync() or fsync(). Just as it's not
modified by stat().

sync() and fsync() do cache->disk, while the file itself stays the
same.

OTOH msync(MS_ASYNC) does memory->file, which is a conceptually file
modifying operation. OK, msync(MS_ASYNC) is actually a no-op on
2.6.18+, but that's purely an implementation detail and no application
should be relying on it.

Before 2.6.18 sync() or fsync() acually didn't flush data written
through a shared mapping to disk, only msync(MS_SYNC), because the
dirty state was only available in the page tables, not in the page or
the inode.

Miklos
-
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/



Relevant Pages

  • Re: [patch 01/22] update ctime and mtime for mmaped write
    ... or the inode being written out due to normal system ... activity would also cause the metadata to be updated. ... The file isn't _modified_ by sync() or fsync(). ...
    (Linux-Kernel)
  • Re: Syncing a files metadata in a portable way
    ... > says clearly that in order to sync metadata an "explicit fsync on the file ... It depends on the Linux filesystem. ...
    (Linux-Kernel)
  • Re: How to determine write failure?
    ... including those requiring modifications to ... The fsync() function shall request that all data for the open file ... metadata stat information. ... This seems to match the behaviour specified by POSIX, ...
    (comp.unix.programmer)
  • Re: BWF2XML, new version
    ... will stay in sync on the Apple Timeline? ... the pulled up time-stamps of native 29.97fps TC BWF files from the DEVA ... the simplest form of metadata tags differ from machine to machine. ...
    (rec.arts.movies.production.sound)
  • Using fsync() to synchronize a USB mass storage device failed
    ... "The fsync() function shall request that all data for the open file ... To my interpretation this means that all buffers of a mass storage ... for a simple sync() call the whole ... Because there may be multiple storage device attached, ...
    (Linux-Kernel)