Return-Path: Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: (qmail 42267 invoked from network); 11 Apr 2011 18:54:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Apr 2011 18:54:46 -0000 Received: (qmail 90710 invoked by uid 500); 11 Apr 2011 18:54:46 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 90676 invoked by uid 500); 11 Apr 2011 18:54:46 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 90655 invoked by uid 99); 11 Apr 2011 18:54:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Apr 2011 18:54:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Apr 2011 18:54:44 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id BA5679DE98 for ; Mon, 11 Apr 2011 18:54:06 +0000 (UTC) Date: Mon, 11 Apr 2011 18:54:06 +0000 (UTC) From: "Daryn Sharp (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <1432780078.50059.1302548046760.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1662151784.7671.1300314149596.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HDFS-1760) problems with getFullPathName MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HDFS-1760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018506#comment-13018506 ] Daryn Sharp commented on HDFS-1760: ----------------------------------- Ignore last comment. Wrong jira. > problems with getFullPathName > ----------------------------- > > Key: HDFS-1760 > URL: https://issues.apache.org/jira/browse/HDFS-1760 > Project: Hadoop HDFS > Issue Type: Bug > Components: name-node > Affects Versions: 0.22.0 > Reporter: Daryn Sharp > Assignee: Daryn Sharp > Fix For: 0.23.0 > > Attachments: HDFS-1760.patch > > > FSDirectory's getFullPathName method is flawed. Given a list of inodes, it starts at index 1 instead of 0 (based on the assumption that inode[0] is always the root inode) and then builds the string with "/"+inode[i]. This means the empty string is returned for the root, or when requesting the full path of the parent dir for top level items. > In addition, it's not guaranteed that the list of inodes starts with the root inode. The inode lookup routine will only fill the inode array with the last n-many inodes of a path if the array is smaller than the path. In these cases, getFullPathName will skip the first component of the relative path, and then assume the second component starts at the root. ex. "a/b/c" becomes "/b/c". > There are a few places in the code where the issue was hacked around by assuming that a 0-length path meant a hardcoded "/" instead of Path.SEPARATOR. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira