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

Yi Liu commented on HDFS-7659:
------------------------------

{quote}
Why don't we just add the negative check to the condition: if(oldLength < 
newLength) {
{quote}
For this my consideration is {{newLength >= 0}} doesn't need the FSN write 
lock, it's a bit more efficient if the user passes a negative value. 

> We should check the new length of truncate can't be a negative value.
> ---------------------------------------------------------------------
>
>                 Key: HDFS-7659
>                 URL: https://issues.apache.org/jira/browse/HDFS-7659
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: datanode, namenode
>            Reporter: Yi Liu
>            Assignee: Yi Liu
>             Fix For: 3.0.0
>
>         Attachments: HDFS-7659.001.patch
>
>
> It's obvious that we should check the new length of truncate can't be a 
> negative value.



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

Reply via email to