|
@@ -1404,9 +1404,10 @@ public class FSDirectory implements Closeable {
|
|
if (srcs.endsWith(HdfsConstants.SEPARATOR_DOT_SNAPSHOT_DIR)) {
|
|
if (srcs.endsWith(HdfsConstants.SEPARATOR_DOT_SNAPSHOT_DIR)) {
|
|
return getSnapshotsListing(srcs, startAfter);
|
|
return getSnapshotsListing(srcs, startAfter);
|
|
}
|
|
}
|
|
- final INodesInPath inodesInPath = getLastINodeInPath(srcs);
|
|
|
|
|
|
+ final INodesInPath inodesInPath = getINodesInPath(srcs, true);
|
|
|
|
+ final INode[] inodes = inodesInPath.getINodes();
|
|
final int snapshot = inodesInPath.getPathSnapshotId();
|
|
final int snapshot = inodesInPath.getPathSnapshotId();
|
|
- final INode targetNode = inodesInPath.getLastINode();
|
|
|
|
|
|
+ final INode targetNode = inodes[inodes.length - 1];
|
|
if (targetNode == null)
|
|
if (targetNode == null)
|
|
return null;
|
|
return null;
|
|
byte parentStoragePolicy = isSuperUser ?
|
|
byte parentStoragePolicy = isSuperUser ?
|
|
@@ -1515,7 +1516,8 @@ public class FSDirectory implements Closeable {
|
|
byte policyId = includeStoragePolicy && i != null && !i.isSymlink() ?
|
|
byte policyId = includeStoragePolicy && i != null && !i.isSymlink() ?
|
|
i.getStoragePolicyID() : BlockStoragePolicySuite.ID_UNSPECIFIED;
|
|
i.getStoragePolicyID() : BlockStoragePolicySuite.ID_UNSPECIFIED;
|
|
return i == null ? null : createFileStatus(HdfsFileStatus.EMPTY_NAME, i,
|
|
return i == null ? null : createFileStatus(HdfsFileStatus.EMPTY_NAME, i,
|
|
- policyId, inodesInPath.getPathSnapshotId(), isRawPath, inodesInPath);
|
|
|
|
|
|
+ policyId, inodesInPath.getPathSnapshotId(), isRawPath,
|
|
|
|
+ inodesInPath);
|
|
} finally {
|
|
} finally {
|
|
readUnlock();
|
|
readUnlock();
|
|
}
|
|
}
|
|
@@ -2186,7 +2188,6 @@ public class FSDirectory implements Closeable {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* This method is always called with writeLock of FSDirectory held.
|
|
* This method is always called with writeLock of FSDirectory held.
|
|
@@ -2835,7 +2836,7 @@ public class FSDirectory implements Closeable {
|
|
* @return consolidated file encryption info; null for non-encrypted files
|
|
* @return consolidated file encryption info; null for non-encrypted files
|
|
*/
|
|
*/
|
|
FileEncryptionInfo getFileEncryptionInfo(INode inode, int snapshotId,
|
|
FileEncryptionInfo getFileEncryptionInfo(INode inode, int snapshotId,
|
|
- INodesInPath iip) throws IOException {
|
|
|
|
|
|
+ INodesInPath iip) throws IOException {
|
|
if (!inode.isFile()) {
|
|
if (!inode.isFile()) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -3037,7 +3038,7 @@ public class FSDirectory implements Closeable {
|
|
}
|
|
}
|
|
|
|
|
|
private XAttr unprotectedGetXAttrByName(INode inode, int snapshotId,
|
|
private XAttr unprotectedGetXAttrByName(INode inode, int snapshotId,
|
|
- String xAttrName)
|
|
|
|
|
|
+ String xAttrName)
|
|
throws IOException {
|
|
throws IOException {
|
|
List<XAttr> xAttrs = XAttrStorage.readINodeXAttrs(inode, snapshotId);
|
|
List<XAttr> xAttrs = XAttrStorage.readINodeXAttrs(inode, snapshotId);
|
|
if (xAttrs == null) {
|
|
if (xAttrs == null) {
|