Skip to content

Commit 194b915

Browse files
authored
Merge pull request #26909 from vitalif/wal-sync-fix
os/bluestore: Actually wait until completion in write_sync Reviewed-by: Sage Weil <sage@redhat.com>
2 parents b2bcee3 + c703cf9 commit 194b915

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/os/bluestore/KernelDevice.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,8 @@ int KernelDevice::_sync_write(uint64_t off, bufferlist &bl, bool buffered, int w
798798
}
799799
#ifdef HAVE_SYNC_FILE_RANGE
800800
if (buffered) {
801-
// initiate IO (but do not wait)
802-
r = ::sync_file_range(fd_buffereds[WRITE_LIFE_NOT_SET], off, len, SYNC_FILE_RANGE_WRITE);
801+
// initiate IO and wait till it completes
802+
r = ::sync_file_range(fd_buffereds[WRITE_LIFE_NOT_SET], off, len, SYNC_FILE_RANGE_WRITE|SYNC_FILE_RANGE_WAIT_AFTER|SYNC_FILE_RANGE_WAIT_BEFORE);
803803
if (r < 0) {
804804
r = -errno;
805805
derr << __func__ << " sync_file_range error: " << cpp_strerror(r) << dendl;

0 commit comments

Comments
 (0)