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

Vinayakumar B commented on HDFS-6886:
-------------------------------------

Got it. :)
I think changing permission check in startFileInternal(..) as follows would be 
applicable for all cases.
{code}    if (isPermissionEnabled) {
      if (overwrite && myFile != null) {
        checkPathAccess(pc, src, FsAction.WRITE);
      }
      checkAncestorAccess(pc, src, FsAction.WRITE);
    }{code}
checkAncestorAccess(..) this will be needed in both cases of overwrite or new 
file creation. And if this file already exists, this will check the WRITE 
permission for the parent. So one more check for deletion not required.

> Use single editlog record for creating file + overwrite.
> --------------------------------------------------------
>
>                 Key: HDFS-6886
>                 URL: https://issues.apache.org/jira/browse/HDFS-6886
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: namenode
>            Reporter: Yi Liu
>            Assignee: Yi Liu
>            Priority: Critical
>         Attachments: HDFS-6886.001.patch, HDFS-6886.002.patch, editsStored
>
>
> As discussed in HDFS-6871, as [~jingzhao] and [~cmccabe]'s suggestion, we 
> could do further improvement to use one editlog record for creating file + 
> overwrite in this JIRA. We could record the overwrite flag in editlog for 
> creating file.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to