Temporary files: RAM or disk?
Posted Jun 4, 2012 10:24 UTC (Mon) by dvdeug (subscriber, #10998)
Posted Jun 4, 2012 10:33 UTC (Mon) by andresfreund (subscriber, #69562)
Posted Jun 4, 2012 11:20 UTC (Mon) by neilbrown (subscriber, #359)
O_SYNC means every write request is safe before the write system call returns.
An alternate semantic is that a file is safe once the last "close" on it returns. I believe this has been implemented for VFAT filesystems which people sometimes like to pull out of their computers without due care.
It is quite an acceptable trade-off in that context.
This is nearly equivalent to always calling fsync() just before close().
Adding a generic mount option to impose this semantic on any fs might be acceptable. It might at least silence some complaints.
Posted Jun 4, 2012 12:19 UTC (Mon) by andresfreund (subscriber, #69562)
Sometimes I wish userspace controllable metadata transactions where possible with a sensible effort/interface...
Posted Jun 4, 2012 16:44 UTC (Mon) by dgm (subscriber, #49227)
POSIX offers a tool to make sure your data is safely stored: the fsync() call. POSIX and the standard C library are careful not to make any promises regarding the reliability of writes, because this would mean a burden for all systems implementing those semantics, some of which do not even have a concept of fail-proof disk writes.
Now Linux could chose to deviate from the standard, but that would be exactly the reverse of portability, wouldn't it?
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds