FileStore overflow for 8 exabytes filesystem

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


Hello,

We had a user report this interesting one with amazon EFS:

https://discuss.elastic.co/t/elasticsearch-with-amazon-elastic-file-system/55867/8

FileStore.java overflows here, all the methods look like this:

    @Override
    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