Conversation
The details of how to achieve this is described in the issue, please refer. Idea is, utilze those unused 31bits in 'op_ret' (ie, return value) field for identifying the exact error (or as close as possible). Plan is to handle fop by fop for this change. Best way to see the result is by changing the lookup() fop, as that actually is expected to return failure most times than success. use 'IS_ERROR(ret)' instead of (ret < 0) or (ret == -1) cases. Updates: #280 Change-Id: If6e22e7aa170f3800c0f29156c4bfc700f790fef Signed-off-by: Amar Tumballi <amar@kadalu.io>
amarts
commented
May 5, 2020
| } | ||
|
|
||
| if (ret == -1) | ||
| if (ret < 0) |
Owner
Author
There was a problem hiding this comment.
revisit this page, and change things to IS_ERROR()
| pida[0] = pid; | ||
| ret = prociter(find_gsyncd, pida); | ||
| if (ret == -1 || pida[1] == -1) { | ||
| if (IS_ERROR(ret) || pida[1] == -1) { |
Owner
Author
There was a problem hiding this comment.
need IS_ERROR() on plda too.
geo-replication/src/procdiggy.c
Outdated
| break; | ||
|
|
||
| if (gf_string2int(de->d_name, &pid) != -1 && pid >= 0) { | ||
| if (NOT_ERROR(gf_string2int(de->d_name, &pid) != -1 && pid)) { |
libglusterfs/src/cluster-syncop.c
Outdated
|
|
||
| for (i = 0; i < numsubvols; i++) { | ||
| if (replies[i].valid && replies[i].op_ret >= 0) { | ||
| if (NOT_ERROR(replies[i].valid && replies[i].op_ret)) { |
| int32_t | ||
| gf_error_to_errno(int32_t error); | ||
|
|
||
| #define SET_ERROR(xlidx, xlid, reason) \ |
libglusterfs/src/glusterfs/list.h
Outdated
|
|
||
| while (pos != head) { | ||
| if (compare(new, pos) >= 0) | ||
| if (NOT_ERROR(compare(new, pos))) |
libglusterfs/src/logging.c
Outdated
| PRINT_SIZE_CHECK(ret, out, strsize); | ||
|
|
||
| for ((i = size - 3); i >= 0; i--) { | ||
| for (NOT_ERROR((i = size - 3); i); i--) { |
libglusterfs/src/store.c
Outdated
| ret = gf_store_sync_direntry(tmppath); | ||
| out: | ||
| if (shandle && shandle->tmp_fd >= 0) { | ||
| if (NOT_ERROR(shandle && shandle->tmp_fd)) { |
libglusterfs/src/store.c
Outdated
| } | ||
| out: | ||
| if (shandle && shandle->tmp_fd >= 0) { | ||
| if (NOT_ERROR(shandle && shandle->tmp_fd)) { |
| if (IS_ERROR(read_subvol)) { | ||
| ret = afr_inode_split_brain_choice_get(inode, this, &spb_choice); | ||
| if ((ret == 0) && spb_choice >= 0) | ||
| if (NOT_ERROR((ret == 0) && spb_choice)) |
amarts
commented
May 5, 2020
| case AFR_FAV_CHILD_BY_SIZE: | ||
| fav_child = afr_sh_fav_by_size(this, replies, inode); | ||
| if (policy_str && fav_child >= 0) { | ||
| if (NOT_ERROR(policy_str && fav_child)) { |
* for cases of ((ret) >= 0) Change-Id: I275f77d91262a856f24e389f3366180cac4a5cbb Signed-off-by: Amar Tumballi <amar@kadalu.io>
8808225 to
d3051dc
Compare
Change-Id: I34711960e57a54a726307e0ee17df5ecc9b36766 Signed-off-by: Amar Tumballi <amar@kadalu.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The details of how to achieve this is described in the issue, please
refer. Idea is, utilze those unused 31bits in 'op_ret' (ie, return
value) field for identifying the exact error (or as close as possible).
Plan is to handle fop by fop for this change. Best way to see the result
is by changing the lookup() fop, as that actually is expected to return
failure most times than success.
use 'IS_ERROR(ret)' instead of (ret < 0) or (ret == -1) cases.
Updates: #280
Change-Id: If6e22e7aa170f3800c0f29156c4bfc700f790fef
Signed-off-by: Amar Tumballi amar@kadalu.io