From: wanglinke Date: Wed, 27 Mar 2024 09:51:04 +0000 (+0800) Subject: os/bluestore: fix the problem that estimate the log size incorrectly X-Git-Tag: v19.2.3~295^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2fb10e92f69c5df1bbb2ba52ba991a892b84d97a;p=ceph.git os/bluestore: fix the problem that estimate the log size incorrectly In BlueFS::_estimate_log_size_N, the total size of the dir was calculated incorrectly. Fixes: https://tracker.ceph.com/issues/65176 co-author: Jrchyang Yu Signed-off-by: Wang Linke (cherry picked from commit 61058bf102f9ed7dbe2e601f5a1243be5149df06) --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 96936c0d73b8..e6e86ef489c0 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -2437,7 +2437,7 @@ uint64_t BlueFS::_estimate_log_size_N() int avg_file_size = 12; uint64_t size = 4096 * 2; size += nodes.file_map.size() * (1 + sizeof(bluefs_fnode_t)); - size += nodes.dir_map.size() + (1 + avg_dir_size); + size += nodes.dir_map.size() * (1 + avg_dir_size); size += nodes.file_map.size() * (1 + avg_dir_size + avg_file_size); return round_up_to(size, super.block_size); }