Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E5EDC200B9A for ; Fri, 7 Oct 2016 22:34:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E4EAB160AE8; Fri, 7 Oct 2016 20:34:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 326D1160AC6 for ; Fri, 7 Oct 2016 22:34:23 +0200 (CEST) Received: (qmail 45284 invoked by uid 500); 7 Oct 2016 20:34:20 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 45070 invoked by uid 99); 7 Oct 2016 20:34:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Oct 2016 20:34:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 99BDB2C0B04 for ; Fri, 7 Oct 2016 20:34:20 +0000 (UTC) Date: Fri, 7 Oct 2016 20:34:20 +0000 (UTC) From: "Sailesh Mukil (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HDFS-10982) 'errno' set on successful code path in hdfsOpenFileImpl() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 07 Oct 2016 20:34:24 -0000 Sailesh Mukil created HDFS-10982: ------------------------------------ Summary: 'errno' set on successful code path in hdfsOpenFileImpl() Key: HDFS-10982 URL: https://issues.apache.org/jira/browse/HDFS-10982 Project: Hadoop HDFS Issue Type: Bug Components: libhdfs Affects Versions: 2.7.0 Reporter: Sailesh Mukil In hdfsOpenFileImpl() in libhdfs/hdfs.c, the following code is used to check if the underlying FileSystem class supports direct reads (i.e. read(ByteBuffer)): {code:java} if ((flags & O_WRONLY) == 0) { // Try a test read to see if we can do direct reads char buf; if (readDirect(fs, file, &buf, 0) == 0) { // Success - 0-byte read should return 0 file->flags |= HDFS_FILE_SUPPORTS_DIRECT_READ; } else if (errno != ENOTSUP) { // Unexpected error. Clear it, don't set the direct flag. fprintf(stderr, "hdfsOpenFile(%s): WARN: Unexpected error %d when testing " "for direct read compatibility\n", path, errno); } } ret = 0; {code} The S3A connector, specifically S3AInputStream does not support direct reads, and therefore it sets 'errno = ENOTSUP' on a call to readDirect(). This 'errno' should be reset before returning the call because this is not an actual error and we're okay with not having direct reads supported. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org