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

FileContext#umask is not initialized properly

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: None
    • Labels:
      None
    • Target Version/s:

      Description

      Notice field umask is not set to parameter theUmask and theUmask is unused.

      FileContext.java
        private FileContext(final AbstractFileSystem defFs,
          final FsPermission theUmask, final Configuration aConf) {
          defaultFS = defFs;
          umask = FsPermission.getUMask(aConf);
          conf = aConf;
      ...
        public static FileContext getFileContext(final AbstractFileSystem defFS,
                          final Configuration aConf) {
          return new FileContext(defFS, FsPermission.getUMask(aConf), aConf);
        }
      

      Proposal:

      • Set umask to theUmask. Since the only caller getFileContext already passes the same value in theUmask, there is no change in behavior.

        Activity

        Hide
        jzhuge John Zhuge added a comment -

        An alternative proposal is to remove the parameter theUmask.

        Show
        jzhuge John Zhuge added a comment - An alternative proposal is to remove the parameter theUmask .
        Hide
        jzhuge John Zhuge added a comment -

        Patch 001:

        • Set umask to theUmask in FileContext#FileContext
        Show
        jzhuge John Zhuge added a comment - Patch 001: Set umask to theUmask in FileContext#FileContext
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 21s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
        +1 mvninstall 8m 9s trunk passed
        +1 compile 8m 31s trunk passed
        +1 checkstyle 0m 22s trunk passed
        +1 mvnsite 0m 56s trunk passed
        +1 mvneclipse 0m 13s trunk passed
        +1 findbugs 1m 22s trunk passed
        +1 javadoc 0m 47s trunk passed
        +1 mvninstall 0m 39s the patch passed
        +1 compile 7m 0s the patch passed
        +1 javac 7m 0s the patch passed
        +1 checkstyle 0m 27s the patch passed
        +1 mvnsite 0m 57s the patch passed
        +1 mvneclipse 0m 14s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 28s the patch passed
        +1 javadoc 0m 45s the patch passed
        +1 unit 13m 28s hadoop-common in the patch passed.
        +1 asflicense 0m 21s The patch does not generate ASF License warnings.
        47m 25s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:85209cc
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12812939/HADOOP-13315.001.patch
        JIRA Issue HADOOP-13315
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 8bf386f06119 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / dca298d
        Default Java 1.8.0_91
        findbugs v3.0.0
        Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/9863/testReport/
        modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/9863/console
        Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 21s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 mvninstall 8m 9s trunk passed +1 compile 8m 31s trunk passed +1 checkstyle 0m 22s trunk passed +1 mvnsite 0m 56s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 1m 22s trunk passed +1 javadoc 0m 47s trunk passed +1 mvninstall 0m 39s the patch passed +1 compile 7m 0s the patch passed +1 javac 7m 0s the patch passed +1 checkstyle 0m 27s the patch passed +1 mvnsite 0m 57s the patch passed +1 mvneclipse 0m 14s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 28s the patch passed +1 javadoc 0m 45s the patch passed +1 unit 13m 28s hadoop-common in the patch passed. +1 asflicense 0m 21s The patch does not generate ASF License warnings. 47m 25s Subsystem Report/Notes Docker Image:yetus/hadoop:85209cc JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12812939/HADOOP-13315.001.patch JIRA Issue HADOOP-13315 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 8bf386f06119 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / dca298d Default Java 1.8.0_91 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/9863/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/9863/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        eddyxu Lei (Eddy) Xu added a comment -

        +1. This private constructor is only be called in FileContext#getFileConext which has a duplicated FsPermission.getMask(...).

        Thanks for finding the bug, John.

        Show
        eddyxu Lei (Eddy) Xu added a comment - +1. This private constructor is only be called in FileContext#getFileConext which has a duplicated FsPermission.getMask(...) . Thanks for finding the bug, John.
        Hide
        jzhuge John Zhuge added a comment -

        Thanks Lei (Eddy) Xu!

        Show
        jzhuge John Zhuge added a comment - Thanks Lei (Eddy) Xu !
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-trunk-Commit #10084 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10084/)
        HADOOP-13315. FileContext#umask is not initialized properly. (John Zhuge (lei: rev a290a98b6ab2424ae9b7faab0ce9496d09ca46f3)

        • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileContext.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #10084 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10084/ ) HADOOP-13315 . FileContext#umask is not initialized properly. (John Zhuge (lei: rev a290a98b6ab2424ae9b7faab0ce9496d09ca46f3) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileContext.java

          People

          • Assignee:
            jzhuge John Zhuge
            Reporter:
            jzhuge John Zhuge
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development