diff options
Diffstat (limited to 'src/block/block_mgr.c')
-rw-r--r-- | src/block/block_mgr.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/block/block_mgr.c b/src/block/block_mgr.c index 0bb75d129e1..06150a0f062 100644 --- a/src/block/block_mgr.c +++ b/src/block/block_mgr.c @@ -411,11 +411,21 @@ __bm_stat(WT_BM *bm, WT_SESSION_IMPL *session, WT_DSRC_STATS *stats) * Flush a file to disk. */ static int -__bm_sync(WT_BM *bm, WT_SESSION_IMPL *session, bool async) +__bm_sync(WT_BM *bm, WT_SESSION_IMPL *session, bool block) { - return (async ? - __wt_fsync_async(session, bm->block->fh) : - __wt_fsync(session, bm->block->fh)); + WT_DECL_RET; + + if (!block && !bm->block->nowait_sync_available) + return (0); + + if ((ret = __wt_fsync(session, bm->block->fh, block)) == 0) + return (0); + + /* Ignore ENOTSUP, but don't try again. */ + if (ret != ENOTSUP) + return (ret); + bm->block->nowait_sync_available = false; + return (0); } /* |