[ 
https://issues.apache.org/jira/browse/HDFS-7902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14364457#comment-14364457
 ] 

Colin Patrick McCabe commented on HDFS-7902:
--------------------------------------------

{code}
130     int createUrlForNnTRUNCATE(const char *host, int nnPort, const char 
*path,
131                                size_t newlength, const char *user, char 
**url)
...
139           strlength = snprintf(newlengthStr, LONG_STR_LEN, "%lu", 
newlength);
{code}

"newlength" should be a {{tOffset}} like it is in the {{hdfs.h}} API.  It 
should be {{%llu}} because on 32-bit systems, "long" is not a 64-bit type.

{code}
1143        ret = createUrlForNnTRUNCATE(fs->nn, fs->port, absPath,
1144                                     newlength, fs->userName, &url);
1145        free(absPath);
1146        if (ret) {
1147            errno = ret;
1148            return -1;
1149        }
{code}
"url" isn't freed on the error case here.  Similarly with resp.

> Expose truncate API for libwebhdfs
> ----------------------------------
>
>                 Key: HDFS-7902
>                 URL: https://issues.apache.org/jira/browse/HDFS-7902
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: native, webhdfs
>    Affects Versions: 2.7.0
>            Reporter: Yi Liu
>            Assignee: Yi Liu
>         Attachments: HDFS-7902.001.patch, HDFS-7902.002.patch
>
>
> As Colin suggested in HDFS-7838, we will add truncate support for libwebhdfs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to