You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/03/17 12:16:11 UTC

[GitHub] [ozone] ayushtkn commented on a change in pull request #2054: Deleting at bucket root throws NPE

ayushtkn commented on a change in pull request #2054:
URL: https://github.com/apache/ozone/pull/2054#discussion_r595960251



##########
File path: hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java
##########
@@ -496,6 +496,11 @@ public boolean delete(Path f, boolean recursive) throws IOException {
     String key = pathToKey(f);
     boolean result;
 
+    if (f.isRoot()) {

Review comment:
       There is a similar check below inside `innerDelete`-
   ```
       try {
         DeleteIterator iterator = new DeleteIterator(f, recursive);
   
         if (f.isRoot()) {
           LOG.warn("Cannot delete root directory.");
           return false;
         }
   ```
   Does that not work? Or will that be redundant post this? 
   In any case this should be inside `    if (status.isDirectory()) {` block




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org