Stephen Chu created HDFS-4981:
---------------------------------

             Summary: chmod 777 the .snapshot directory does not error that 
modification on RO snapshot is disallowed
                 Key: HDFS-4981
                 URL: https://issues.apache.org/jira/browse/HDFS-4981
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: snapshots
    Affects Versions: 2.0.4-alpha, 3.0.0
            Reporter: Stephen Chu
            Priority: Trivial


Snapshots currently are RO, so it's expected that when someone tries to modify 
the .snapshot directory s/he is denied.

However, if the user tries to chmod 777 the .snapshot directory, the operation 
does not error. The user should be alerted that modifications are not allowed, 
even if this operation didn't actually change anything.

Using other modes will trigger the error, though.

{code}
[schu@hdfs-snapshots-1 hdfs]$ sudo -u hdfs hdfs dfs -chmod 777 
/user/schu/test_dir_1/.snapshot/
[schu@hdfs-snapshots-1 hdfs]$ sudo -u hdfs hdfs dfs -chmod 755 
/user/schu/test_dir_1/.snapshot/
chmod: changing permissions of '/user/schu/test_dir_1/.snapshot': Modification 
on a read-only snapshot is disallowed
[schu@hdfs-snapshots-1 hdfs]$ sudo -u hdfs hdfs dfs -chmod 435 
/user/schu/test_dir_1/.snapshot/
chmod: changing permissions of '/user/schu/test_dir_1/.snapshot': Modification 
on a read-only snapshot is disallowed
[schu@hdfs-snapshots-1 hdfs]$ sudo -u hdfs hdfs dfs -chown hdfs 
/user/schu/test_dir_1/.snapshot/
chown: changing ownership of '/user/schu/test_dir_1/.snapshot': Modification on 
a read-only snapshot is disallowed
[schu@hdfs-snapshots-1 hdfs]$ sudo -u hdfs hdfs dfs -chown schu 
/user/schu/test_dir_1/.snapshot/
chown: changing ownership of '/user/schu/test_dir_1/.snapshot': Modification on 
a read-only snapshot is disallowed
[schu@hdfs-snapshots-1 hdfs]$ 
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to