gfs2-utils: master - fsck.gfs2: Remove dead code from scan_inode_list

Andrew Price andyp at fedoraproject.org
Mon Oct 6 18:54:07 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=bfd21b2144184a4cdf3628599152a5dbe1c3d0ab
Commit:        bfd21b2144184a4cdf3628599152a5dbe1c3d0ab
Parent:        53d8c671e58f471417584e0a68eb49d32afaa295
Author:        Andrew Price <anprice at redhat.com>
AuthorDate:    Mon Oct 6 13:41:17 2014 +0100
Committer:     Andrew Price <anprice at redhat.com>
CommitterDate: Mon Oct 6 13:41:17 2014 +0100

fsck.gfs2: Remove dead code from scan_inode_list

Spotted by coverity: At condition "ii = (struct inode_info *)tmp", the
value of "ii" cannot be "NULL".

In other words, tmp cannot be NULL here because the loop would have
ended in that case. Remove the NULL check and the overly excited error
message.

Signed-off-by: Andrew Price <anprice at redhat.com>
---
 gfs2/fsck/pass4.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/gfs2/fsck/pass4.c b/gfs2/fsck/pass4.c
index 7b3cb87..f9d08dc 100644
--- a/gfs2/fsck/pass4.c
+++ b/gfs2/fsck/pass4.c
@@ -55,10 +55,7 @@ static int scan_inode_list(struct gfs2_sbd *sdp) {
 		if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
 			return 0;
 		next = osi_next(tmp);
-		if (!(ii = (struct inode_info *)tmp)) {
-			log_crit( _("osi_tree broken in scan_info_list!!\n"));
-			exit(FSCK_ERROR);
-		}
+		ii = (struct inode_info *)tmp;
 		/* Don't check reference counts on the special gfs files */
 		if (sdp->gfs1 &&
 		    ((ii->di_num.no_addr == sdp->md.riinode->i_di.di_num.no_addr) ||


More information about the cluster-commits mailing list