FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 01-20-2012, 02:10 PM
 
Default fsck.gfs2: Don't use strerror for libgfs2 errors

From: Bob Peterson <rpeterso@redhat.com>

This patch removes the calls to strerror from initialize.c.
The errors returned by libgfs2 currently don't conform to system
errors. For example, they can return positive or negative numbers.
Therefore, strerror could segfault or give nonsense messages.
I hate numeric error messages as much as the next guy, but using
strerror won't work until we systematically go through libgfs2 and
make all the return codes conform to the rules strerror lives by.

rhbz#675723
---
gfs2/fsck/initialize.c | 14 ++++++--------
gfs2/fsck/lost_n_found.c | 4 ++--
2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 7171cdd..7b47374 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -464,8 +464,8 @@ static void lookup_per_node(struct gfs2_sbd *sdp, int allow_rebuild)

err = build_per_node(sdp);
if (err) {
- log_crit(_("Error rebuilding per_node directory: %s
"),
- strerror(err));
+ log_crit(_("Error %d rebuilding per_node directory
"),
+ err);
exit(FSCK_ERROR);
}
}
@@ -577,8 +577,8 @@ static int init_system_inodes(struct gfs2_sbd *sdp)
}
err = build_inum(sdp);
if (err) {
- log_crit(_("Error rebuilding inum inode: %s
"),
- strerror(err));
+ log_crit(_("Error %d rebuilding inum inode
"),
+ err);
exit(FSCK_ERROR);
}
gfs2_lookupi(sdp->master_dir, "inum", 4,
@@ -609,8 +609,7 @@ static int init_system_inodes(struct gfs2_sbd *sdp)
}
err = build_statfs(sdp);
if (err) {
- log_crit(_("Error rebuilding statfs inode: %s
"),
- strerror(err));
+ log_crit(_("Error %d rebuilding statfs inode
"), err);
exit(FSCK_ERROR);
}
gfs2_lookupi(sdp->master_dir, "statfs", 6, &sdp->md.statfs);
@@ -646,8 +645,7 @@ static int init_system_inodes(struct gfs2_sbd *sdp)
}
err = build_quota(sdp);
if (err) {
- log_crit(_("Error rebuilding quota inode: %s
"),
- strerror(err));
+ log_crit(_("Error %d rebuilding quota inode
"), err);
exit(FSCK_ERROR);
}
gfs2_lookupi(sdp->master_dir, "quota", 5, &sdp->md.qinode);
diff --git a/gfs2/fsck/lost_n_found.c b/gfs2/fsck/lost_n_found.c
index d109283..70a9181 100644
--- a/gfs2/fsck/lost_n_found.c
+++ b/gfs2/fsck/lost_n_found.c
@@ -153,8 +153,8 @@ int add_inode_to_lf(struct gfs2_inode *ip){
lf_dip = createi(sdp->md.rooti, "lost+found",
S_IFDIR | 0700, 0);
if (lf_dip == NULL) {
- log_crit(_("Error creating lost+found: %s
"),
- strerror(errno));
+ log_crit(_("Error %d creating lost+found: %s
"),
+ errno);
exit(FSCK_ERROR);
}

--
1.7.7.5
 

Thread Tools




All times are GMT. The time now is 11:56 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org