Github user animeshtrivedi commented on a diff in the pull request:
https://github.com/apache/incubator-crail/pull/16#discussion_r180314443
--- Diff:
storage-nvmf/src/main/java/org/apache/crail/storage/nvmf/NvmfStorageServer.java
---
@@ -86,15 +100,15 @@ public void run() {
@Override
public StorageResource allocateResource() throws Exception {
StorageResource resource = null;
-
+
if (alignedSize > 0){
LOG.info("new block, length " +
NvmfStorageConstants.ALLOCATION_SIZE);
- LOG.debug("block stag 0, offset " + offset + ", length
" + NvmfStorageConstants.ALLOCATION_SIZE);
+ LOG.debug("block stag 0, address " + address + ",
length " + NvmfStorageConstants.ALLOCATION_SIZE);
alignedSize -= NvmfStorageConstants.ALLOCATION_SIZE;
- resource = StorageResource.createResource(offset,
(int)NvmfStorageConstants.ALLOCATION_SIZE, 0);
- offset += NvmfStorageConstants.ALLOCATION_SIZE;
+ resource = StorageResource.createResource(address,
(int)NvmfStorageConstants.ALLOCATION_SIZE, 0);
--- End diff --
#sad. Why not make ALLOCATION_SIZE an integer to start with. It is a long
which is bad because a user might be tempted to give it a > 2GB values
considering it is a long.
---