[
https://issues.apache.org/jira/browse/HDFS-4981?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14901423#comment-14901423
]
Xiao Chen commented on HDFS-4981:
---------------------------------
Hi Stephen,
After some investigation, the root cause is that
{{FsShellPermissions#processPath}} inside common has the optimization that if
new permission is the same as current, no further checking is done. (The
'Modification on a read-only snapshot is disallowed' message is from
{{FSDirectory#getINodesInPath4Write}} inside hdfs.
At this point, the most reasonable enhancement I can think of is to add a
special check for the .snapshot dir in FsShellPermissions. However, considering
1. Since the perm check is ignored, no action is taken. The only thing
missing is the error message.
2. The possible fix is located in common where snapshot feature should not be
exposed
3. According to the design in HDFS-2802, RW snapshots may be supported in the
future. In this case we have to revert the check outside (or at least change
the message)
I suggest not to add the fix for now.
Please let me know if you have any suggestions/feedback.
Thanks.
> 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: 3.0.0, 2.0.4-alpha
> Reporter: Stephen Chu
> Assignee: Xiao Chen
> 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 was sent by Atlassian JIRA
(v6.3.4#6332)