Gitweb:
http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=18d0318b...
Commit: 18d0318b96a6b88698fb9ffdfbb3176ae7119f9e
Parent: a96c74f47ec41e85a5cd6eef969d7231831a2c37
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Thu Jun 5 01:35:44 2014 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Thu Jun 5 01:40:18 2014 +0100
gfs2-utils: Fix two logic errors
Two uses of lgfs2_get_leaf_ptr() were still expecting it to return 0 on
failure. Remove the negations.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/savemeta.c | 2 +-
gfs2/fsck/pass2.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index e336100..a43045f 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -542,7 +542,7 @@ static void save_inode_data(struct metafd *mfd)
int li;
for (li = 0; li < (1 << inode->i_di.di_depth); li++) {
- if (!lgfs2_get_leaf_ptr(inode, li, &leaf_no)) {
+ if (lgfs2_get_leaf_ptr(inode, li, &leaf_no)) {
fprintf(stderr, "Could not read leaf index %d in dinode
%"PRIu64"\n", li,
(uint64_t)inode->i_di.di_num.no_addr);
exit(-1);
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 2474ccb..2971b8c 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -370,7 +370,7 @@ static int wrong_leaf(struct gfs2_inode *ip, struct gfs2_inum *entry,
de->de_type) == 0) {
log_err(_("The misplaced directory entry was moved to a "
"valid leaf block.\n"));
- if (!lgfs2_get_leaf_ptr(ip, hash_index, &real_leaf)) {
+ if (lgfs2_get_leaf_ptr(ip, hash_index, &real_leaf)) {
log_err(_("Could not read leaf %d in dinode %"PRIu64": %s\n"),
hash_index,
(uint64_t)ip->i_di.di_num.no_addr, strerror(errno));
}