]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Journaler: call set_layout after init_headers.
authorGreg Farnum <gregf@hq.newdream.net>
Tue, 15 Feb 2011 16:58:48 +0000 (08:58 -0800)
committerGreg Farnum <gregf@hq.newdream.net>
Tue, 15 Feb 2011 17:01:08 +0000 (09:01 -0800)
set_layout modifies last_committed, but then init_headers
uses operator= and overwrites those changes. In this case
it doesn't matter as they're both writing the same changes,
but make the ordering explicit for the future.

Signed-off-by: Greg Farnum <gregf@hq.newdream.net>
src/osdc/Journaler.cc

index 0f8e378c7de4724d1c09fde9b2271d3d7152c33c..90063e9dd02fd240fa200229e1e661df45296b55 100644 (file)
@@ -199,13 +199,12 @@ void Journaler::_finish_read_head(int r, bufferlist& bl)
     return;
   }
 
-  set_layout(&h.layout);
-
   write_pos = flush_pos = ack_pos = safe_pos = h.write_pos;
   read_pos = requested_pos = received_pos = expire_pos = h.expire_pos;
   trimmed_pos = trimming_pos = h.trimmed_pos;
 
   init_headers(h);
+  set_layout(&h.layout);
 
   dout(1) << "_finish_read_head " << h << ".  probing for end of log (from " << write_pos << ")..." << dendl;
   C_ProbeEnd *fin = new C_ProbeEnd(this);