All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Price <anprice@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 1/3] gfs2-utils: Fix two logic errors
Date: Thu,  5 Jun 2014 02:28:04 +0100	[thread overview]
Message-ID: <1401931686-6697-1-git-send-email-anprice@redhat.com> (raw)

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@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));
 		}
-- 
1.9.3



             reply	other threads:[~2014-06-05  1:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05  1:28 Andrew Price [this message]
2014-06-05  1:28 ` [Cluster-devel] [PATCH 2/3] gfs2_edit: Ensure all leaf blocks in per_node are saved Andrew Price
2014-06-05  9:39   ` Steven Whitehouse
2014-06-05 10:39     ` Andrew Price
2014-06-05  1:28 ` [Cluster-devel] [PATCH 3/3] gfs2-utils tests: Add small-block savemeta tests Andrew Price

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401931686-6697-1-git-send-email-anprice@redhat.com \
    --to=anprice@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.