[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH 62/66] fsck.gfs2: Fix initialization error return codes



From: Bob Peterson <rpeterso redhat com>

In initialize.c there are several places where it can exit with an error.
These places return with -1 where they should return the standard fsck
error FSCK_ERROR.

rhbz#675723
---
 gfs2/fsck/initialize.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 608eb32..7171cdd 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -466,13 +466,13 @@ static void lookup_per_node(struct gfs2_sbd *sdp, int allow_rebuild)
 		if (err) {
 			log_crit(_("Error rebuilding per_node directory: %s\n"),
 				 strerror(err));
-			exit(-1);
+			exit(FSCK_ERROR);
 		}
 	}
 	gfs2_lookupi(sdp->master_dir, "per_node", 8, &sdp->md.pinode);
 	if (!sdp->md.pinode) {
 		log_err( _("Unable to rebuild per_node; aborting.\n"));
-		exit(-1);
+		exit(FSCK_ERROR);
 	}
 }
 
@@ -579,7 +579,7 @@ static int init_system_inodes(struct gfs2_sbd *sdp)
 			if (err) {
 				log_crit(_("Error rebuilding inum inode: %s\n"),
 					 strerror(err));
-				exit(-1);
+				exit(FSCK_ERROR);
 			}
 			gfs2_lookupi(sdp->master_dir, "inum", 4,
 				     &sdp->md.inum);
@@ -611,7 +611,7 @@ static int init_system_inodes(struct gfs2_sbd *sdp)
 		if (err) {
 			log_crit(_("Error rebuilding statfs inode: %s\n"),
 				 strerror(err));
-			exit(-1);
+			exit(FSCK_ERROR);
 		}
 		gfs2_lookupi(sdp->master_dir, "statfs", 6, &sdp->md.statfs);
 		if (!sdp->md.statfs) {
@@ -648,7 +648,7 @@ static int init_system_inodes(struct gfs2_sbd *sdp)
 		if (err) {
 			log_crit(_("Error rebuilding quota inode: %s\n"),
 				 strerror(err));
-			exit(-1);
+			exit(FSCK_ERROR);
 		}
 		gfs2_lookupi(sdp->master_dir, "quota", 5, &sdp->md.qinode);
 		if (!sdp->md.qinode) {
@@ -1156,7 +1156,7 @@ static int fill_super_block(struct gfs2_sbd *sdp)
 
 	if (compute_constants(sdp)) {
 		log_crit(_("Bad constants (1)\n"));
-		exit(-1);
+		exit(FSCK_ERROR);
 	}
 	ret = read_sb(sdp, 1);
 	if (ret < 0) {
-- 
1.7.7.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]