Skip to content

Commit

Permalink
filestore: log about syncfs(2) etc support
Browse files Browse the repository at this point in the history
Fixes: #2479
Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
liewegas committed May 30, 2012
1 parent 2b856ac commit 07498d6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/os/FileStore.cc
Expand Up @@ -1471,6 +1471,25 @@ int FileStore::_detect_fs()
btrfs = false;
}

#ifdef HAVE_SYS_SYNCFS
if (syncfs(fd) == 0) {
dout(0) << "mount syncfs(2) syscall fully supported (by glibc and kernel)" << dendl;
} else {
dout(0) << "mount syncfs(2) syscall supported by glibc BUT NOT the kernel" << dendl;
} else
#endif
{
if (btrfs) {
dout(0) << "mount syncfs(2) syscall not support by glibc, but the btrfs SYNC ioctl will suffice" << dendl;
} else if (m_filestore_fsync_flushes_journal_data) {
dout(0) << "mount syncfs(2) syscall not support by glibc, but 'filestore fsync flushes journal data = true', so fsync will suffice." << dendl;
} else {
dout(0) << "mount syncfs(2) syscall not support by glibc; must use sync(2)." << dendl;
dout(0) << "mount WARNING: multiple ceph-osd daemons on the same host will be slow" << dendl;
}
}


TEMP_FAILURE_RETRY(::close(fd));
return 0;
}
Expand Down

0 comments on commit 07498d6

Please sign in to comment.