New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fuse reports incorrect disk usage #6160
Comments
Looking at the documentation, it looks like we should always use 512 as the block size when calculating the number of blocks. I wish I were kidding but: "This field indicates the number of blocks allocated to the file, in 512-byte units." Basically, "block" is just being used to mean "512 byte chunk". |
@djdv can you make sure your new implementation doesn't have this issue? |
@Stebalien For individual records, we use the first specified unixfs blocksize (if any) for a node. It may be worth disregarding this though and using the same (system-expected) blocksize. The only funny thing I'm doing in regards to metadata at the moment, is specifying a size for directories. As far as I'm aware this isn't defined, so I'm using it to store the entry/child count (for internal use). |
The size of directories depends on the implementation of the underlying filesystem.
|
For directories, we have the option to use the IPFS object size (link+data sizes), but this is the size of the entire encapsulation, not just the |
I believe the correct way to calculate directory size is to sum up all the nodes that make up the directory. However, IMO, this is mostly useless and 0 is probably the best solution (and what |
Version information:
go-ipfs version: 0.4.19-
Repo version: 7
System version: amd64/linux
Golang version: go1.11.4
Type:
Description:
stat
anddu
on fuse reports incorrect disk usage.As can be seen,
stat
reports the number of 256 KB blocks.The same file in ext4 has
stat --format %B
reports 'the size in bytes of each block reported by %b' as 512 in both cases.The text was updated successfully, but these errors were encountered: