From ee44d8fb3f407fb23580fe24d077784e3a63d445 Mon Sep 17 00:00:00 2001 From: Haohui Mai Date: Wed, 5 Nov 2014 20:29:17 -0800 Subject: [PATCH] HDFS-7367. HDFS short-circuit read cannot negotiate shared memory slot and file descriptors when SASL is enabled on DataTransferProtocol. Contributed by Chris Nauroth. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 4 ++++ .../protocol/datatransfer/sasl/SaslDataTransferServer.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index fb87dc1c186..9eabe8a4548 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -885,6 +885,10 @@ Release 2.6.0 - UNRELEASED fails on Windows, because we cannot deny access to the file owner. (Chris Nauroth via wheat9) + HDFS-7367. HDFS short-circuit read cannot negotiate shared memory slot and + file descriptors when SASL is enabled on DataTransferProtocol. + (Chris Nauroth via wheat9) + BREAKDOWN OF HDFS-6134 AND HADOOP-10150 SUBTASKS AND RELATED JIRAS HDFS-6387. HDFS CLI admin tool for creating & deleting an diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/SaslDataTransferServer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/SaslDataTransferServer.java index 005856d8ce8..9f94534db67 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/SaslDataTransferServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/SaslDataTransferServer.java @@ -277,6 +277,11 @@ public class SaslDataTransferServer { */ private IOStreamPair getSaslStreams(Peer peer, OutputStream underlyingOut, InputStream underlyingIn, final DatanodeID datanodeId) throws IOException { + if (peer.hasSecureChannel() || + dnConf.getTrustedChannelResolver().isTrusted(getPeerAddress(peer))) { + return new IOStreamPair(underlyingIn, underlyingOut); + } + SaslPropertiesResolver saslPropsResolver = dnConf.getSaslPropsResolver(); Map saslProps = saslPropsResolver.getServerProperties( getPeerAddress(peer));