Skip to content

Commit

Permalink
Merge pull request #183 from DSL-UMD/distributed
Browse files Browse the repository at this point in the history
[FIX] root dir
  • Loading branch information
gangliao authored Sep 23, 2019
2 parents a01c4ef + efd6017 commit 514bc25
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public INode get(long id) {
INode inode = INodeKeyedObjects.getCache().getIfPresent(Long.class, id);
if (inode == null) {
DatabaseINode.LoadINode node = new DatabaseINode().loadINode(id);
byte[] name = (node.name != null) ? DFSUtil.string2Bytes(node.name) : null;
byte[] name = (node.name != null && node.length > 0) ? DFSUtil.string2Bytes(node.name) : null;
if (node.header != 0L) {
inode = new INodeFile(node.id);
inode.asFile().setNumBlocks();
Expand Down Expand Up @@ -98,7 +98,7 @@ public INode get(long parentId, String childName) {
.getIfPresent(Pair.class, new ImmutablePair<>((Long) parentId, childName));
if (inode == null) {
DatabaseINode.LoadINode node = new DatabaseINode().loadINode(parentId, childName);
byte[] name = (node.name != null) ? DFSUtil.string2Bytes(node.name) : null;
byte[] name = (node.name != null && node.length > 0) ? DFSUtil.string2Bytes(node.name) : null;
if (node.header != 0L) {
inode = new INodeFile(node.id);
inode.asFile().setNumBlocks();
Expand Down

0 comments on commit 514bc25

Please sign in to comment.