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

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=14409bc4ff53cd8c596d2eb06b881840195089de
Commit:        14409bc4ff53cd8c596d2eb06b881840195089de
Parent:        b1a74af43a6f1eea42e9536f5d360130dbb8e394
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:03:04 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 bfe0456..60ccf39 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -457,7 +457,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;
@@ -493,7 +493,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 45d3dec..ec097ad 100644
--- a/gfs2/fsck/pass1c.c
+++ b/gfs2/fsck/pass1c.c
@@ -226,7 +226,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;
 
@@ -237,7 +237,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:03 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:05 STABLE2 - 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).