[Toybox] Stat, wrong blockcount for F2FS filesystems?

darken darken at darken.eu
Fri Apr 7 11:31:30 PDT 2017


Wrong train of thought, toybox stat doesn't do any blockcount calculation,
but just gets the value from `st_blocks`.

We are getting bad values from `/storage/emulated/0` which is FUSE mounted
from `/data/media/0` and the blockcount values from `/data/media/0` are
sane.

So this seems to be FUSE related...

~Matthias

2017-04-07 18:10 GMT+02:00 darken <darken at darken.eu>:

> I'm using stat to display filesize and allocated size in my Android app.
>
> I calculate the allocated size by multiplying the block count (%b) with
> 512 Byte.
>
> I found out in https://github.com/landley/toybox/issues/41 that the
> blocksize for the blockcount calculation is hardcoded to 512. So this
> should work well (and has so far).
>
> Now a user of my app noticed that on their F2FS filesystem the allocated
> size is suspiciously small:
> https://github.com/d4rken/sdmaid-public/issues/830
>
> Specifically too small by a factor of 8, as if the blocksize used for
> blockcount calculation is 4096 (4096/512).
>
> Could stat have a problem with calculating the blockcount on F2FS
> filesystems or am I overlooking something else?
>
> ~Matthias
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170407/7acc01e9/attachment.htm>


More information about the Toybox mailing list