Honor filestore_flush_min in the inline flush case.
Backport: bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit
49726dcf973c38c7313ab78743b45ccc879671ea)
if (!should_flush ||
!m_filestore_flusher ||
!queue_flusher(fd, offset, len)) {
- if (m_filestore_sync_flush)
+ if (should_flush && m_filestore_sync_flush)
::sync_file_range(fd, offset, len, SYNC_FILE_RANGE_WRITE);
lfn_close(fd);
}
#else
// no sync_file_range; (maybe) flush inline and close.
- if (m_filestore_sync_flush)
+ if (should_flush && m_filestore_sync_flush)
::fdatasync(fd);
lfn_close(fd);
#endif