Hadoop Common
  1. Hadoop Common
  2. HADOOP-6897

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

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major 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;
        }
      
      1. mkdirs.patch
        0.8 kB
        Hairong Kuang

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

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

              Dates

              • Created:
                Updated:

                Development