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

Konstantin Shvachko commented on HDFS-7659:
-------------------------------------------

Agreed about Preconditions.
Why don't we just add the negative check to the condition: {{if(oldLength < 
newLength) {}}

For the test an attempt to truncate to < 0 size could be added to 
{{testTruncateFailure()}}.
I guess these type of conditions to be implemented in TestCLI for truncate 
under HDFS-7058.

> 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