]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore/BlueFS: fix flush_bdev placement 13911/head
authorSage Weil <sage@redhat.com>
Thu, 9 Mar 2017 21:51:21 +0000 (16:51 -0500)
committerSage Weil <sage@redhat.com>
Thu, 9 Mar 2017 23:15:38 +0000 (18:15 -0500)
commit2924a96493d8570317e55854a25fc64911ecf151
tree0e5fbca6ce6e7110919d48ec467a27f907668a06
parent6b3c52643c8e5fa820c53d96608862b7649c3fd0
os/bluestore/BlueFS: fix flush_bdev placement

We need to flush any new writes on any fsync().  Notably, this includes
the rocksdb log. However, previously _fsync was only doing a bdev flush if
we also had a dirty bluefs journal and called into _sync_and_flush_journal.
If we didn't, we weren't doing a flush() at all, which could lead to
corrupted data.

Fix this by moving the first flush_bdev *out* of _sync_and_flush_log.  (The
second one is there to flush the bluefs journal; the first one was to
ensure prior writes are stable.)  Instead, flush prior writes in all of the
callers prior to calling _sync_and_flush_log.  This includes _fsync (and
fixes the bug by covering the non-journal-flush path) as well as several
other callers.

Fixes: http://tracker.ceph.com/issues/19250
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueFS.cc