All of lore.kernel.org
 help / color / mirror / Atom feed
From: rpeterso@sourceware.org <rpeterso@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/gfs2/fsck metawalk.c pass1.c pass1b.c  ...
Date: 28 Jun 2007 23:41:38 -0000	[thread overview]
Message-ID: <20070628234138.5799.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	rpeterso at sourceware.org	2007-06-28 23:41:37

Modified files:
	gfs2/fsck      : metawalk.c pass1.c pass1b.c pass1c.c pass5.c 

Log message:
	Revolves: bz 245803: GFS2: buffer count underflow for block
	29581 (0x738d)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/metawalk.c.diff?cvsroot=cluster&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/pass1.c.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/pass1b.c.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/pass1c.c.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/pass5.c.diff?cvsroot=cluster&r1=1.4&r2=1.5

--- cluster/gfs2/fsck/metawalk.c	2007/05/15 18:11:10	1.9
+++ cluster/gfs2/fsck/metawalk.c	2007/06/28 23:41:37	1.10
@@ -501,9 +501,9 @@
 			error = check_leaf_eattr(ip, block, indirect, pass);
 			ea_leaf_ptr++;
 		}
+		brelse(indirect_buf, not_updated);
 	}
 
-	brelse(indirect_buf, not_updated);
 	return error;
 }
 
--- cluster/gfs2/fsck/pass1.c	2007/05/15 18:11:10	1.8
+++ cluster/gfs2/fsck/pass1.c	2007/06/28 23:41:37	1.9
@@ -147,10 +147,6 @@
 
 	/* This inode contains an eattr - it may be invalid, but the
 	 * eattr attributes points to a non-zero block */
-	log_debug("Setting %" PRIu64 " (0x%" PRIx64 ") to eattr block\n",
-			  indirect, indirect);
-	gfs2_block_set(bl, indirect, gfs2_eattr_block);
-
 	if(gfs2_check_range(sdp, indirect)) {
 		/*log_warn("EA indirect block #%"PRIu64" is out of range.\n",
 			indirect);
@@ -171,6 +167,10 @@
 		ret = 1;
 	}
 	else {
+		log_debug("Setting %" PRIu64 " (0x%"
+			  PRIx64 ") to eattr block\n", indirect, indirect);
+		gfs2_block_set(bl, indirect, gfs2_eattr_block);
+
 		*bh = bread(sdp, indirect);
 		block = be64_to_cpu(*(*bh)->b_data);
 		if(gfs2_check_meta(*bh, GFS2_METATYPE_IN)) {
@@ -186,7 +186,6 @@
 			gfs2_block_set(bl, block, gfs2_indir_blk);
 			bc->ea_count++;
 		}
-		brelse(*bh, not_updated);
 	}
 	return ret;
 }
--- cluster/gfs2/fsck/pass1b.c	2007/01/23 19:23:07	1.4
+++ cluster/gfs2/fsck/pass1b.c	2007/06/28 23:41:37	1.5
@@ -214,6 +214,7 @@
 	struct dup_handler *dh = (struct dup_handler *) private;
 	/* Can't use fxns from eattr.c since we need to check the ref
 	 * count */
+	*bh = NULL;
 	if(dh->ref_count == 1)
 		return 1;
 	if(block == dh->b->block_no) {
--- cluster/gfs2/fsck/pass1c.c	2007/01/23 19:23:07	1.5
+++ cluster/gfs2/fsck/pass1c.c	2007/06/28 23:41:37	1.6
@@ -47,7 +47,7 @@
 	int *update = (int *) private;
 	struct gfs2_sbd *sbp = ip->i_sbd;
 	struct gfs2_block_query q;
-	struct gfs2_buffer_head *indir_bh;
+	struct gfs2_buffer_head *indir_bh = NULL;
 
 	if(gfs2_check_range(sbp, block)) {
 		log_err("Extended attributes indirect block out of range...removing\n");
--- cluster/gfs2/fsck/pass5.c	2007/01/23 19:23:07	1.4
+++ cluster/gfs2/fsck/pass5.c	2007/06/28 23:41:37	1.5
@@ -21,9 +21,13 @@
 #include "fs_bits.h"
 #include "util.h"
 
-int convert_mark(enum gfs2_mark_block mark, uint32_t *count)
+int convert_mark(struct gfs2_block_query *q, uint32_t *count)
 {
-	switch(mark) {
+	if (q->eattr_block) {
+		count[2]++;
+		return GFS2_BLKST_USED;
+	}
+	switch(q->block_type) {
 
 	case gfs2_meta_inval:
 		/* Convert invalid metadata to free blocks */
@@ -54,7 +58,7 @@
 		return GFS2_BLKST_USED;
 
 	default:
-		log_err("Invalid state %d found\n", mark);
+		log_err("Invalid state %d found\n", q->block_type);
 		return -1;
 	}
 	return -1;
@@ -83,7 +87,7 @@
 			return 0;
 		gfs2_block_check(bl, block, &q);
 
-		block_status = convert_mark(q.block_type, count);
+		block_status = convert_mark(&q, count);
 
 		if (rg_status != block_status) {
 			const char *blockstatus[] = {"Free", "Data", "Invalid", "inode"};



             reply	other threads:[~2007-06-28 23:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-28 23:41 rpeterso [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-06-28 23:42 [Cluster-devel] cluster/gfs2/fsck metawalk.c pass1.c pass1b.c rpeterso
2007-09-18 18:14 rpeterso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070628234138.5799.qmail@sourceware.org \
    --to=rpeterso@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.