public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* RHEL5 - GFS2: gfs2_fsck: fix segfault while running special block lists.
@ 2008-09-24 17:57 Bob Peterson
  0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2008-09-24 17:57 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c387199bca6c04c79b1224638a8474e9bec53dbb
Commit:        c387199bca6c04c79b1224638a8474e9bec53dbb
Parent:        447a6bab4e1a00f6cb60198923c7847c441949f3
Author:        Bob Peterson <rpeterso@redhat.com>
AuthorDate:    Wed Sep 24 11:50:22 2008 -0500
Committer:     Bob Peterson <rpeterso@redhat.com>
CommitterDate: Wed Sep 24 12:05:58 2008 -0500

GFS2: gfs2_fsck: fix segfault while running special block lists.

bz 463588 - GFS2: gfs2_fsck segfaults when extended attributes are on the file system

The gfs2_fsck tool was running special block lists with
osi_list_foreach but then it was sometimes deleting the
entries from the lists.  Therefore it should have been using
osi_list_foreach_safe instead.
---
 gfs2/fsck/pass1b.c |    4 ++--
 gfs2/fsck/pass1c.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 0fcfc06..8c2bb75 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -470,7 +470,7 @@ int pass1b(struct gfs2_sbd *sbp)
 	struct blocks *b;
 	uint64_t i;
 	struct gfs2_block_query q;
-	osi_list_t *tmp = NULL;
+	osi_list_t *tmp = NULL, *x;
 	struct metawalk_fxns find_dirents = {0};
 	find_dirents.check_dentry = &find_dentry;
 	int rc = 0;
@@ -506,7 +506,7 @@ int pass1b(struct gfs2_sbd *sbp)
 		   (q.block_type == gfs2_inode_chr) ||
 		   (q.block_type == gfs2_inode_fifo) ||
 		   (q.block_type == gfs2_inode_sock)) {
-			osi_list_foreach(tmp, &sbp->dup_blocks.list) {
+			osi_list_foreach_safe(tmp, &sbp->dup_blocks.list, x) {
 				b = osi_list_entry(tmp, struct blocks, list);
 				if(find_block_ref(sbp, i, b)) {
 					stack;
diff --git a/gfs2/fsck/pass1c.c b/gfs2/fsck/pass1c.c
index 4e42021..f8d57d7 100644
--- a/gfs2/fsck/pass1c.c
+++ b/gfs2/fsck/pass1c.c
@@ -238,7 +238,7 @@ int pass1c(struct gfs2_sbd *sbp)
 	struct gfs2_inode *ip = NULL;
 	struct metawalk_fxns pass1c_fxns = { 0 };
 	int error = 0;
-	osi_list_t *tmp;
+	osi_list_t *tmp, *x;
 	struct special_blocks *ea_block;
 	enum update_flags want_updated = not_updated;
 
@@ -249,7 +249,7 @@ int pass1c(struct gfs2_sbd *sbp)
 	pass1c_fxns.private = NULL;
 
 	log_info("Looking for inodes containing ea blocks...\n");
-	osi_list_foreach(tmp, &sbp->eattr_blocks.list) {
+	osi_list_foreach_safe(tmp, &sbp->eattr_blocks.list, x) {
 		ea_block = osi_list_entry(tmp, struct special_blocks, list);
 		block_no = ea_block->block;
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-24 17:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-24 17:57 RHEL5 - GFS2: gfs2_fsck: fix segfault while running special block lists Bob Peterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).