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

Ayush Saxena commented on HDFS-13377:
-------------------------------------

Thanx [~hadoop_yangyun] for the update.
Seems I didn't catch the change in {{private void checkOwner(FSDirectory fsd, 
FSPermissionChecker pc, String path, long nsQuota, long dsQuota)}}
I suppose we just need to check, whether the last Inode owner and the caller 
user are same or not, no need to check whether quota is set or not, all these 
checks.
IMO, in {{FSDirAttrOP}} you can refactor {{setQuota(..)}} to add one parameter, 
to specify whether to check owner or not and do something like this :

{code:java}
      if (allowOwner & !pc.isSuperUser()) {
        if (iip.getLastINode().getUserName().equals(pc.getUser())) {
          // THROW ACE
        }
{code}
and in FSNamesystem just :

{code:java}
    try {
      if(!allowOwner) {
        checkSuperuserPrivilege(pc);
      }
{code}
IMO all the other stuff isn't required..

> The owner of folder can set quota for his sub folder
> ----------------------------------------------------
>
>                 Key: HDFS-13377
>                 URL: https://issues.apache.org/jira/browse/HDFS-13377
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: namenode
>            Reporter: Yang Yun
>            Assignee: Yang Yun
>            Priority: Minor
>         Attachments: HADOOP-13377.patch, HDFS-13377.patch, HDFS-13377.patch
>
>
> Currently, only  super user can set quota. That is huge burden for 
> administrator in a large system. Add a new feature to let the owner of a 
> folder also has the privilege to set quota for his sub folders. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to