Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-6897

FileSystem#mkdirs(FileSystem, Path, FsPermission) should not call setPermission if mkdirs failled

    Details

    • Type: Bug
    • Status: Patch Available
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.22.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Here is the piece of code that has the bug. fs.setPermission should not be called if result is false.

        public static boolean mkdirs(FileSystem fs, Path dir, FsPermission permission)
        throws IOException {
          // create the directory using the default permission
          boolean result = fs.mkdirs(dir);
          // set its permission to be the supplied one
          fs.setPermission(dir, permission);
          return result;
        }
      

        Attachments

        1. mkdirs.patch
          0.8 kB
          Hairong Kuang

          Issue Links

            Activity

              People

              • Assignee:
                hairong Hairong Kuang
                Reporter:
                hairong Hairong Kuang
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated: