|
@@ -6794,6 +6794,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
|
|
|
/** Allow snapshot on a directroy. */
|
|
|
void allowSnapshot(String path) throws SafeModeException, IOException {
|
|
|
+ checkOperation(OperationCategory.WRITE);
|
|
|
writeLock();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
@@ -6819,6 +6820,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
|
|
|
/** Disallow snapshot on a directory. */
|
|
|
void disallowSnapshot(String path) throws SafeModeException, IOException {
|
|
|
+ checkOperation(OperationCategory.WRITE);
|
|
|
writeLock();
|
|
|
try {
|
|
|
checkOperation(OperationCategory.WRITE);
|
|
@@ -6942,6 +6944,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
public SnapshottableDirectoryStatus[] getSnapshottableDirListing()
|
|
|
throws IOException {
|
|
|
SnapshottableDirectoryStatus[] status = null;
|
|
|
+ checkOperation(OperationCategory.READ);
|
|
|
final FSPermissionChecker checker = getPermissionChecker();
|
|
|
readLock();
|
|
|
try {
|
|
@@ -6975,6 +6978,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
SnapshotDiffReport getSnapshotDiffReport(String path,
|
|
|
String fromSnapshot, String toSnapshot) throws IOException {
|
|
|
SnapshotDiffInfo diffs = null;
|
|
|
+ checkOperation(OperationCategory.READ);
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
readLock();
|
|
|
try {
|