Skip to content

Commit

Permalink
namespace: mv workaround, allow mv between direcrories having none st…
Browse files Browse the repository at this point in the history
…orageclass
  • Loading branch information
DmitryLitvintsev committed Oct 15, 2024
1 parent 72e9d6e commit bdc323f
Showing 1 changed file with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -678,13 +678,22 @@ public void rename(Subject subject, @Nullable PnfsId pnfsId,
sourceAttributes =
getFileAttributes(new ExtendedInode(_fs, inode), attributes);
}
if (!(nullToEmpty(destDirAttributes.getStorageClass()).
equals(nullToEmpty(sourceAttributes.getStorageClass())) &&
nullToEmpty(destDirAttributes.getCacheClass()).
equals(nullToEmpty(sourceAttributes.getCacheClass())))) {
throw new PermissionDeniedCacheException("Mv denied: " +
dest.getParent() +
" has different storage tags; use cp.");
String destStorageClass = nullToEmpty(destDirAttributes.getStorageClass());
String srcStorageClass = nullToEmpty(sourceAttributes.getStorageClass());

if (!srcStorageClass.equals("none.none") &&
!destStorageClass.equals("none.none") &&
!srcStorageClass.equals("") &&
!destStorageClass.equals("")) {

if (!(nullToEmpty(destDirAttributes.getStorageClass()).
equals(nullToEmpty(sourceAttributes.getStorageClass())) &&
nullToEmpty(destDirAttributes.getCacheClass()).
equals(nullToEmpty(sourceAttributes.getCacheClass())))) {
throw new PermissionDeniedCacheException("Mv denied: " +
dest.getParent() +
" has different storage tags; use cp.");
}
}
}
}
Expand Down

0 comments on commit bdc323f

Please sign in to comment.