Fix counting of sizes for new directories

This commit is contained in:
Yorhel 2021-07-19 16:58:34 +02:00
parent f473f3605e
commit a915fc0836

View file

@ -204,7 +204,7 @@ const ScanDir = struct {
// entire subtree, which, in turn, would break all shared hardlink // entire subtree, which, in turn, would break all shared hardlink
// sizes. The current approach may result in incorrect sizes after // sizes. The current approach may result in incorrect sizes after
// refresh, but I expect the difference to be fairly minor. // refresh, but I expect the difference to be fairly minor.
if (e.etype != .dir and (e.blocks != stat.blocks or e.size != stat.size)) { if (!(e.etype == .dir and e.counted) and (e.blocks != stat.blocks or e.size != stat.size)) {
e.delStats(parents); e.delStats(parents);
e.blocks = stat.blocks; e.blocks = stat.blocks;
e.size = stat.size; e.size = stat.size;