Merge HDFS-5789. Some of snapshot APIs missing checkOperation double check in fsn. Contributed by Uma Maheswara Rao G.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1560732 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b650f912ad
commit
96a9a59822
|
@ -836,6 +836,8 @@ Release 2.3.0 - UNRELEASED
|
||||||
HDFS-5649. Unregister NFS and Mount service when NFS gateway is shutting down.
|
HDFS-5649. Unregister NFS and Mount service when NFS gateway is shutting down.
|
||||||
(brandonli)
|
(brandonli)
|
||||||
|
|
||||||
|
HDFS-5789. Some of snapshot APIs missing checkOperation double check in fsn. (umamahesh)
|
||||||
|
|
||||||
Release 2.2.0 - 2013-10-13
|
Release 2.2.0 - 2013-10-13
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -6777,6 +6777,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
||||||
|
|
||||||
/** Allow snapshot on a directroy. */
|
/** Allow snapshot on a directroy. */
|
||||||
void allowSnapshot(String path) throws SafeModeException, IOException {
|
void allowSnapshot(String path) throws SafeModeException, IOException {
|
||||||
|
checkOperation(OperationCategory.WRITE);
|
||||||
writeLock();
|
writeLock();
|
||||||
try {
|
try {
|
||||||
checkOperation(OperationCategory.WRITE);
|
checkOperation(OperationCategory.WRITE);
|
||||||
|
@ -6802,6 +6803,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
||||||
|
|
||||||
/** Disallow snapshot on a directory. */
|
/** Disallow snapshot on a directory. */
|
||||||
void disallowSnapshot(String path) throws SafeModeException, IOException {
|
void disallowSnapshot(String path) throws SafeModeException, IOException {
|
||||||
|
checkOperation(OperationCategory.WRITE);
|
||||||
writeLock();
|
writeLock();
|
||||||
try {
|
try {
|
||||||
checkOperation(OperationCategory.WRITE);
|
checkOperation(OperationCategory.WRITE);
|
||||||
|
@ -6925,6 +6927,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
||||||
public SnapshottableDirectoryStatus[] getSnapshottableDirListing()
|
public SnapshottableDirectoryStatus[] getSnapshottableDirListing()
|
||||||
throws IOException {
|
throws IOException {
|
||||||
SnapshottableDirectoryStatus[] status = null;
|
SnapshottableDirectoryStatus[] status = null;
|
||||||
|
checkOperation(OperationCategory.READ);
|
||||||
final FSPermissionChecker checker = getPermissionChecker();
|
final FSPermissionChecker checker = getPermissionChecker();
|
||||||
readLock();
|
readLock();
|
||||||
try {
|
try {
|
||||||
|
@ -6958,6 +6961,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
||||||
SnapshotDiffReport getSnapshotDiffReport(String path,
|
SnapshotDiffReport getSnapshotDiffReport(String path,
|
||||||
String fromSnapshot, String toSnapshot) throws IOException {
|
String fromSnapshot, String toSnapshot) throws IOException {
|
||||||
SnapshotDiffInfo diffs = null;
|
SnapshotDiffInfo diffs = null;
|
||||||
|
checkOperation(OperationCategory.READ);
|
||||||
final FSPermissionChecker pc = getPermissionChecker();
|
final FSPermissionChecker pc = getPermissionChecker();
|
||||||
readLock();
|
readLock();
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue