-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Use bitwise '&' instead of logical '&&' #6722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Make two instances of the same change. Change bitwise AND (&) to logical AND (&&). Currently the code uses a bitwise AND between two boolean values. In the first instance; The first operand is a flag that has been bitwise combined with a bit mask to get a boolean value as to whether a file has group write permissions set. The second operand used is a struct member that is intended as a boolean flag not a bit mask. In the second instance the argument is the same except with world write permissions instead of group write (S_IWOTH, S_IWGRP). Signed-off-by: Tobin C. Harding <me@tobin.cc>
chrisrd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
behlendorf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find.
|
Title wrong, surely ? Use bitwise '&' instead of logical '&&' should be Use logical '&&' instead of bitwise '&'. |
|
What's the protocol here @dcb314 @behlendorf? If the PR has been merged already changing the incorrect title is not going to help the git log summary in tree? |
|
Nothing to be done, once it's committed it is what it is. |
Make two instances of the same change. Change bitwise AND (&) to logical AND (&&). Currently the code uses a bitwise AND between two boolean values. In the first instance; The first operand is a flag that has been bitwise combined with a bit mask to get a boolean value as to whether a file has group write permissions set. The second operand used is a struct member that is intended as a boolean flag not a bit mask. In the second instance the argument is the same except with world write permissions instead of group write (S_IWOTH, S_IWGRP). Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Chris Dunlop <chris@onthe.net.au> Signed-off-by: Tobin C. Harding <me@tobin.cc> Closes openzfs#6684 Closes openzfs#6722
Make two instances of the same change. Change bitwise AND (&) to logical AND (&&). Currently the code uses a bitwise AND between two boolean values. In the first instance; The first operand is a flag that has been bitwise combined with a bit mask to get a boolean value as to whether a file has group write permissions set. The second operand used is a struct member that is intended as a boolean flag not a bit mask. In the second instance the argument is the same except with world write permissions instead of group write (S_IWOTH, S_IWGRP). Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Chris Dunlop <chris@onthe.net.au> Signed-off-by: Tobin C. Harding <me@tobin.cc> Closes #6684 Closes #6722
Description
Make two instances of the same change. Change bitwise AND (&) to logical
AND (&&).
Motivation and Context
Currently the code uses a bitwise AND between two boolean values.
In the first instance;
The first operand is a flag that has been bitwise combined with a bit
mask to get a boolean value as to whether a file has group write
permissions set.
The second operand used is a struct member that is intended as a
boolean flag not a bit mask.
In the second instance the argument is the same except with world write
permissions instead of group write (S_IWOTH, S_IWGRP).
fixes #6684
Signed-off-by: Tobin C. Harding me@tobin.cc
How Has This Been Tested?
Code is untested.
Types of changes
Checklist:
Signed-off-by.