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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 0.22.0
    • None
    • None
    • 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

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

              Dates

                Created:
                Updated: