]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
os/FileStore: fix non-btrfs op_seq commit order
authorSage Weil <sage@inktank.com>
Fri, 4 Jan 2013 01:15:07 +0000 (17:15 -0800)
committerSage Weil <sage@inktank.com>
Fri, 4 Jan 2013 05:02:35 +0000 (21:02 -0800)
commit39a734fbf34ccd121f17023bcec814e61c8bdaab
tree9899bdcf217fec74028cc0a7f4e1a349805acac5
parent49416619d733572368e5d2ba7f2b34150c754b23
os/FileStore: fix non-btrfs op_seq commit order

The op_seq file is the starting point for journal replay.  For stable btrfs
commit mode, which is using a snapshot as a reference, we should write this
file before we take the snap.  We normally ignore current/ contents anyway.

On non-btrfs file systems, however, we should only write this file *after*
we do a full sync, and we should then fsync(2) it before we continue
(and potentially trim anything from the journal).

This fixes a serious bug that could cause data loss and corruption after
a power loss event.  For a 'kill -9' or crash, however, there was little
risk, since the writes were still captured by the host's cache.

Fixes: #3721
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit 28d59d374b28629a230d36b93e60a8474c902aa5)
src/os/FileStore.cc