]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: encode truncate_pending in inode
authorSage Weil <sage.weil@dreamhost.com>
Tue, 29 Nov 2011 05:37:18 +0000 (21:37 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Tue, 29 Nov 2011 05:39:21 +0000 (21:39 -0800)
Otherwise we don't actually journal this value, and we get confused when
we replay a start_truncate and try to restart it.

Fixes: #1756
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/mds/mdstypes.h

index eeedf6e8b4f3e3cb1c86c75cbb6f50b2be9d6448..faa20d3efc787c3d5bd5634166d8400c377ed37e 100644 (file)
@@ -476,7 +476,7 @@ struct inode_t {
   }
 
   void encode(bufferlist &bl) const {
-    __u8 v = 4;
+    __u8 v = 5;
     ::encode(v, bl);
 
     ::encode(ino, bl);
@@ -496,6 +496,7 @@ struct inode_t {
     ::encode(truncate_seq, bl);
     ::encode(truncate_size, bl);
     ::encode(truncate_from, bl);
+    ::encode(truncate_pending, bl);
     ::encode(mtime, bl);
     ::encode(atime, bl);
     ::encode(time_warp_seq, bl);
@@ -534,6 +535,10 @@ struct inode_t {
     ::decode(truncate_seq, p);
     ::decode(truncate_size, p);
     ::decode(truncate_from, p);
+    if (v >= 5)
+      ::decode(truncate_pending, p);
+    else
+      truncate_pending = 0;
     ::decode(mtime, p);
     ::decode(atime, p);
     ::decode(time_warp_seq, p);