FileStore overflow for 8 exabytes filesystem

Robert Muir rcmuir at
Mon Jul 25 22:03:16 UTC 2016


We had a user report this interesting one with amazon EFS: overflows here, all the methods look like this:

    public long getUsableSpace() throws IOException {
       UnixFileStoreAttributes attrs = readAttributes();
       return attrs.blockSize() * attrs.availableBlocks();

the original blockSize and various block counts are unsigned 64 bit
values, but they are treated as signed longs, then multiplied, and
then it causes negative numbers reported back via FileStore.

What can be done? It seems FileStore API is hopelessly broken since it
returns long, and returns bytes. treating it as unsigned long wouldn't
be that much better...

Should I open a bug?

More information about the nio-dev mailing list