Support "sync=always" for ZVOLs.
authorEtienne Dechamps <etienne.dechamps@ovh.net>
Fri, 2 Sep 2011 07:57:35 +0000 (09:57 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 8 Feb 2012 00:23:06 +0000 (16:23 -0800)
Currently the "sync=always" property works for regular ZFS datasets, but not
for ZVOLs. This patch remedies that.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Fixes #374.

module/zfs/zvol.c

index a25fbbe..9dda040 100644 (file)
@@ -555,7 +555,7 @@ zvol_write(void *arg)
        dmu_tx_commit(tx);
        zfs_range_unlock(rl);
 
-       if (rq_is_sync(req))
+       if (rq_is_sync(req) || zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS)
                zil_commit(zv->zv_zilog, ZVOL_OBJ);
 
        blk_end_request(req, -error, size);