diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 99061c0e65..62141b497f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1126,6 +1126,8 @@ Release 2.3.0 - UNRELEASED HDFS-5649. Unregister NFS and Mount service when NFS gateway is shutting down. (brandonli) + HDFS-5789. Some of snapshot APIs missing checkOperation double check in fsn. (umamahesh) + Release 2.2.0 - 2013-10-13 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index c130fc785b..5b0e0ddbdc 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -6794,6 +6794,7 @@ public SnapshotManager getSnapshotManager() { /** Allow snapshot on a directroy. */ void allowSnapshot(String path) throws SafeModeException, IOException { + checkOperation(OperationCategory.WRITE); writeLock(); try { checkOperation(OperationCategory.WRITE); @@ -6819,6 +6820,7 @@ void allowSnapshot(String path) throws SafeModeException, IOException { /** Disallow snapshot on a directory. */ void disallowSnapshot(String path) throws SafeModeException, IOException { + checkOperation(OperationCategory.WRITE); writeLock(); try { checkOperation(OperationCategory.WRITE); @@ -6942,6 +6944,7 @@ void renameSnapshot(String path, String snapshotOldName, public SnapshottableDirectoryStatus[] getSnapshottableDirListing() throws IOException { SnapshottableDirectoryStatus[] status = null; + checkOperation(OperationCategory.READ); final FSPermissionChecker checker = getPermissionChecker(); readLock(); try { @@ -6975,6 +6978,7 @@ public SnapshottableDirectoryStatus[] getSnapshottableDirListing() SnapshotDiffReport getSnapshotDiffReport(String path, String fromSnapshot, String toSnapshot) throws IOException { SnapshotDiffInfo diffs = null; + checkOperation(OperationCategory.READ); final FSPermissionChecker pc = getPermissionChecker(); readLock(); try {