]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/CDir: correct the write_size
authorXiubo Li <xiubli@redhat.com>
Tue, 1 Dec 2020 04:22:54 +0000 (12:22 +0800)
committerXiubo Li <xiubli@redhat.com>
Tue, 1 Dec 2020 04:33:07 +0000 (12:33 +0800)
Signed-off-by: Xiubo Li <xiubli@redhat.com>
src/mds/CDir.cc

index 3a734e989ffb4d3a5ced0e8e98a2444ea391520c..c28a3d638d2010c4a49ef01bcb898338a13d2bc0 100644 (file)
@@ -2249,7 +2249,7 @@ void CDir::_omap_commit_ops(int r, int op_prio, version_t version, bool _new, bu
   };
 
   for (auto &key : stales) {
-    write_size += key.length();
+    write_size += key.length() + sizeof(__u32);
     _rm.emplace(key);
 
     if (write_size >= max_write_size)
@@ -2259,7 +2259,7 @@ void CDir::_omap_commit_ops(int r, int op_prio, version_t version, bool _new, bu
   for (auto &k : to_remove) {
     string key;
     k.encode(key);
-    write_size += key.length();
+    write_size += key.length() + sizeof(__u32);
     _rm.emplace(std::move(key));
 
     if (write_size >= max_write_size)
@@ -2312,7 +2312,7 @@ void CDir::_omap_commit_ops(int r, int op_prio, version_t version, bool _new, bu
     }
     off += item.dft_len;
 
-    write_size += key.length() + bl.length();
+    write_size += key.length() + bl.length() + 2 * sizeof(__u32);
     _set[std::move(key)].swap(bl);
     if (write_size >= max_write_size)
       commit_one();