You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Andy Isaacson (JIRA)" <ji...@apache.org> on 2012/07/24 01:39:34 UTC

[jira] [Created] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Andy Isaacson created HDFS-3710:
-----------------------------------

             Summary: libhdfs misuses O_RDONLY/WRONLY/RDWR
                 Key: HDFS-3710
                 URL: https://issues.apache.org/jira/browse/HDFS-3710
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: libhdfs
    Affects Versions: 2.0.0-alpha
            Reporter: Andy Isaacson
            Priority: Minor


The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
{code}
if ((flags & O_ACCMODE) == O_RDONLY)
{code}
rather than
{code}
if ((flags & O_RDONLY) == 0)
{code}

There are many examples of this misuse in {{hdfs.c}}.

As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431361#comment-13431361 ] 

Hudson commented on HDFS-3710:
------------------------------

Integrated in Hadoop-Mapreduce-trunk-Commit #2584 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2584/])
    HDFS-3710. libhdfs misuses O_RDONLY/WRONLY/RDWR. Contributed by Andy Isaacson. (Revision 1370898)

     Result = FAILURE
atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1370898
Files : 
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c

                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>             Fix For: 2.2.0-alpha
>
>         Attachments: hdfs-3710-2.txt, hdfs-3710-3.txt, hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421766#comment-13421766 ] 

Hadoop QA commented on HDFS-3710:
---------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12537738/hdfs-3710-2.txt
  against trunk revision .

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 1 new or modified test files.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 eclipse:eclipse.  The patch built with eclipse:eclipse.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    -1 core tests.  The patch failed these unit tests in hadoop-hdfs-project/hadoop-hdfs:

                  org.apache.hadoop.hdfs.TestDatanodeBlockScanner

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/2896//testReport/
Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2896//console

This message is automatically generated.
                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>         Attachments: hdfs-3710-2.txt, hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431812#comment-13431812 ] 

Hudson commented on HDFS-3710:
------------------------------

Integrated in Hadoop-Mapreduce-trunk #1162 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1162/])
    HDFS-3710. libhdfs misuses O_RDONLY/WRONLY/RDWR. Contributed by Andy Isaacson. (Revision 1370898)

     Result = FAILURE
atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1370898
Files : 
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c

                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>             Fix For: 2.2.0-alpha
>
>         Attachments: hdfs-3710-2.txt, hdfs-3710-3.txt, hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431778#comment-13431778 ] 

Hudson commented on HDFS-3710:
------------------------------

Integrated in Hadoop-Hdfs-trunk #1130 (See [https://builds.apache.org/job/Hadoop-Hdfs-trunk/1130/])
    HDFS-3710. libhdfs misuses O_RDONLY/WRONLY/RDWR. Contributed by Andy Isaacson. (Revision 1370898)

     Result = SUCCESS
atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1370898
Files : 
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c

                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>             Fix For: 2.2.0-alpha
>
>         Attachments: hdfs-3710-2.txt, hdfs-3710-3.txt, hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421140#comment-13421140 ] 

Hadoop QA commented on HDFS-3710:
---------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12537629/hdfs-3710.txt
  against trunk revision .

    +1 @author.  The patch does not contain any @author tags.

    -1 tests included.  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 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 eclipse:eclipse.  The patch built with eclipse:eclipse.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    -1 core tests.  The patch failed these unit tests in hadoop-hdfs-project/hadoop-hdfs:

                  org.apache.hadoop.hdfs.server.datanode.TestBlockRecovery
                  org.apache.hadoop.hdfs.server.namenode.metrics.TestNameNodeMetrics

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/2890//testReport/
Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2890//console

This message is automatically generated.
                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>         Attachments: hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431315#comment-13431315 ] 

Hudson commented on HDFS-3710:
------------------------------

Integrated in Hadoop-Hdfs-trunk-Commit #2629 (See [https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2629/])
    HDFS-3710. libhdfs misuses O_RDONLY/WRONLY/RDWR. Contributed by Andy Isaacson. (Revision 1370898)

     Result = SUCCESS
atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1370898
Files : 
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c

                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>         Attachments: hdfs-3710-2.txt, hdfs-3710-3.txt, hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Aaron T. Myers (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron T. Myers updated HDFS-3710:
---------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.0-alpha
     Hadoop Flags: Reviewed
           Status: Resolved  (was: Patch Available)

I've just committed this to trunk and branch-2.

Thanks a lot for the contribution, Andy.
                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>             Fix For: 2.2.0-alpha
>
>         Attachments: hdfs-3710-2.txt, hdfs-3710-3.txt, hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Colin Patrick McCabe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421184#comment-13421184 ] 

Colin Patrick McCabe commented on HDFS-3710:
--------------------------------------------

Looks good.

The only thing that could make it better is adding a line or two to the unit test at:
./hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c

testing that passing mode = 0 to hdfsOpen is no longer incorrectly accepted.
                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>         Attachments: hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Colin Patrick McCabe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431235#comment-13431235 ] 

Colin Patrick McCabe commented on HDFS-3710:
--------------------------------------------

+1
                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>         Attachments: hdfs-3710-2.txt, hdfs-3710-3.txt, hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431301#comment-13431301 ] 

Hadoop QA commented on HDFS-3710:
---------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12539890/hdfs-3710-3.txt
  against trunk revision .

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 1 new or modified test files.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 eclipse:eclipse.  The patch built with eclipse:eclipse.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed unit tests in hadoop-hdfs-project/hadoop-hdfs.

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/2971//testReport/
Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2971//console

This message is automatically generated.
                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>         Attachments: hdfs-3710-2.txt, hdfs-3710-3.txt, hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Colin Patrick McCabe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421186#comment-13421186 ] 

Colin Patrick McCabe commented on HDFS-3710:
--------------------------------------------

er, meant to write "passing mode = 3 to hdfsOpen is no longer incorrectly accepted."
                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>         Attachments: hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Andy Isaacson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Isaacson updated HDFS-3710:
--------------------------------

    Attachment: hdfs-3710-3.txt

Sync patch to recent hdfs changes; fix wording of one error message.
                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>         Attachments: hdfs-3710-2.txt, hdfs-3710-3.txt, hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Andy Isaacson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Isaacson updated HDFS-3710:
--------------------------------

    Attachment: hdfs-3710-2.txt

Add a test that invalid flags value is disallowed.

Also tweak errno on invalid flags; return EINVAL rather than ENOTSUP.
                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>         Attachments: hdfs-3710-2.txt, hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Arun C Murthy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arun C Murthy closed HDFS-3710.
-------------------------------

    
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>             Fix For: 2.0.2-alpha
>
>         Attachments: hdfs-3710-2.txt, hdfs-3710-3.txt, hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Aaron T. Myers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431264#comment-13431264 ] 

Aaron T. Myers commented on HDFS-3710:
--------------------------------------

+1 pending Jenkins.
                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>         Attachments: hdfs-3710-2.txt, hdfs-3710-3.txt, hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Andy Isaacson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Isaacson updated HDFS-3710:
--------------------------------

    Attachment: hdfs-3710.txt
    
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Priority: Minor
>         Attachments: hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Andy Isaacson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Isaacson updated HDFS-3710:
--------------------------------

    Assignee: Andy Isaacson
      Status: Patch Available  (was: Open)
    
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>         Attachments: hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431310#comment-13431310 ] 

Hudson commented on HDFS-3710:
------------------------------

Integrated in Hadoop-Common-trunk-Commit #2564 (See [https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2564/])
    HDFS-3710. libhdfs misuses O_RDONLY/WRONLY/RDWR. Contributed by Andy Isaacson. (Revision 1370898)

     Result = SUCCESS
atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1370898
Files : 
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c

                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>         Attachments: hdfs-3710-2.txt, hdfs-3710-3.txt, hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-3710) libhdfs misuses O_RDONLY/WRONLY/RDWR

Posted by "Colin Patrick McCabe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-3710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421754#comment-13421754 ] 

Colin Patrick McCabe commented on HDFS-3710:
--------------------------------------------

+1 lgtm
                
> libhdfs misuses O_RDONLY/WRONLY/RDWR
> ------------------------------------
>
>                 Key: HDFS-3710
>                 URL: https://issues.apache.org/jira/browse/HDFS-3710
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>            Priority: Minor
>         Attachments: hdfs-3710-2.txt, hdfs-3710.txt
>
>
> The {{O_RDONLY}} / {{O_WRONLY}} / {{O_RDWR}} macros in {{fcntl.h}} are not a bitmask; they are an enum stored in the low bits of the flag word.  The proper way to use them is
> {code}
> if ((flags & O_ACCMODE) == O_RDONLY)
> {code}
> rather than
> {code}
> if ((flags & O_RDONLY) == 0)
> {code}
> There are many examples of this misuse in {{hdfs.c}}.
> As a result of this incorrect testing, erroneous code may be accepted without error and correct code might not work correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira