On Thu, 26 Jul 2007, Damon Atkins wrote: > Guys, > What is the best way to ask for a feature enhancement to ZFS. > > To allow ZFS to be usefull for DR disk replication, we need to be able > set an option against the pool or file system or both, called close > sync. ie When a programme closes a file any outstanding writes are flush > to disk, before the close returns to the programme. So when a programme > ends you are guarantee any state information is save to the disk. > (exit() also results in close being called) > > open(xxx, O_DSYNC) is only good if you can alter the source code. Shell > scripts use of awk, head, tail, echo etc to create output files do not > use O_DSYNC, when the shell script returns 0, you want to know that all > the data is on the disk, so if the system crashes the data is still there. > > PS it would be nice if UFS had closessync as well, instead of using > forcedirectio.
I'd implement this via LD_PRELOAD library, implementing your own 'close', so that this not only dispatches to libc`close but also does an fsync() call on that filedescriptor before. Or, if really wanting to make sourcecode changes, again change it in libc`close(), and make it depend on an environment variable; if DO_CLOSE_SYNC is set, perform fsync(); close() instead of just the latter. There's a problem with sync-on-close anyway - mmap for file I/O. Who guarantees you no file contents are being modified after the close() ? FrankH. _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss