Project

General

Profile

Bug #12512

FileStore calls syncfs(2) even it is not supported

Added by Kefu Chai over 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
07/29/2015
Due date:
% Done:

0%

Source:
Development
Tags:
Backport:
hammer,firefly
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

see

FileStore::sync_entry() calls backend->syncfs() if not backend->can_checkpoint().

and in backend->syncfs():

  if (m_filestore_fsync_flushes_journal_data) {
    dout(15) << "syncfs: doing fsync on " << get_op_fd() << dendl;
    // make the file system's journal commit.
    //  this works with ext3, but NOT ext4
    ret = ::fsync(get_op_fd());
    if (ret < 0)
      ret = -errno;
  } else {
    dout(15) << "syncfs: doing a full sync (syncfs(2) if possible)" << dendl;
    ret = sync_filesystem(get_current_fd());
  }
  return ret;

and filestore_fsync_flushes_journal_data is false as it is by default.

the log reads:

2015-07-29 04:47:47.435637 403e980  0 genericfilestorebackend(/var/lib/ceph/osd/ceph-4) detect_features: syncfs(2) syscall supported by glibc BUT NOT the kernel

because we have "HAVE_SYS_SYNCFS" defined, syncfs(2) is called by sync_filesystem(). hence

2015-07-17T22:28:13.111 INFO:tasks.ceph.osd.1.ovh248040.stderr:2015-07-17 22:28:13.049413 127af700 -1 filestore(/var/lib/ceph/osd/ceph-1) syncfs got (38) Function not implemented

and what brings down the osd is

FileStore::sync_entry()
{
// ....
// ....
    int err = backend->syncfs();
    if (err < 0) {
      derr << "syncfs got " << cpp_strerror(err) << dendl;
      assert(0 == "syncfs returned error");
    }

Related issues

Copied to Ceph - Backport #12586: FileStore calls syncfs(2) even it is not supported Resolved
Copied to Ceph - Backport #12587: FileStore calls syncfs(2) even it is not supported Resolved

Associated revisions

Revision 08210d6a (diff)
Added by Kefu Chai over 3 years ago

common/syncfs: fall back to sync(2) if syncfs(2) not available

Fixes: #12512
Signed-off-by: Kefu Chai <>

Revision d0d67277 (diff)
Added by Kefu Chai over 3 years ago

common/syncfs: fall back to sync(2) if syncfs(2) not available

Fixes: #12512
Signed-off-by: Kefu Chai <>
(cherry picked from commit 08210d6a85527b0759f6dc4411f742bc13a4939f)

Revision a65c3985 (diff)
Added by Kefu Chai about 3 years ago

common/syncfs: fall back to sync(2) if syncfs(2) not available

Fixes: #12512
Signed-off-by: Kefu Chai <>
(cherry picked from commit 08210d6a85527b0759f6dc4411f742bc13a4939f)

Conflicts:
src/common/sync_filesystem.h
- subtle difference in #if/#else/#endif structure

History

#1 Updated by Kefu Chai over 3 years ago

  • Status changed from New to Need Review

#2 Updated by Loic Dachary over 3 years ago

  • Status changed from Need Review to Pending Backport
  • Backport set to hammer,firefly

#3 Updated by Loic Dachary about 3 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF