On 06/05/2010 21:45, Nicolas Williams wrote:
On Thu, May 06, 2010 at 03:30:05PM -0500, Wes Felter wrote:
On 5/6/10 5:28 AM, Robert Milkowski wrote:

sync=disabled
Synchronous requests are disabled. File system transactions
only commit to stable storage on the next DMU transaction group
commit which can be many seconds.
Is there a way (short of DTrace) to write() some data and get
notified when the corresponding txg is committed? Think of it as a
poor man's group commit.
fsync(2) is it.  Of course, if you disable sync writes then there's no
way to find out for sure.  If you need to know when a write is durable,
then don't disable sync writes.

Nico
There is one way - issue a sync(2) - even with sync=disabled it will sync all filesystems and then return.
Another workaround would be to create a snapshot...

However I agree with Nico - if you don't need sync=disabled then don't use it.

Someone else mentioned that yet another option like sync=fsync-only would be useful so all would be async but fsync() - but frankly I'm not convinced as it would require a support in your application but at this point you already have a full control of the behavior without need for sync=disabled.

--
Robert Milkowski
http://milek.blogspot.com

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to