]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
FileJournal: adjust write_pos prior to unlocking write_lock
authorSamuel Just <sam.just@inktank.com>
Tue, 14 May 2013 23:35:48 +0000 (16:35 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 22 May 2013 17:34:41 +0000 (10:34 -0700)
commit3a02e00d1d3b904b312db283faedf4dff37b0f6f
tree2fbffb603eb27cdf0676fae6b9e795b650ea9fe3
parent8a030eb0e1b61121f7b1e2b7a551bb213d1c428b
FileJournal: adjust write_pos prior to unlocking write_lock

In committed_thru, we use write_pos to reset the header.start value in cases
where seq is past the end of our journalq.  It is therefore important that the
journalq be updated atomically with write_pos (that is, under the write_lock).

The call to align_bl() is moved into do_write in order to ensure that write_pos
is adjusted correctly prior to write_bl().

Also, we adjust pos at the end of write_bl() such that pos \in [get_top(),
header.max_size) after write_bl().

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