This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RHEL5 - GFS2: Make gfs2_fsck accept UNLINKED metadata blocks


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=46bf9c4fd9ba8e96224430bb90c33e2483bc7ff9
Commit:        46bf9c4fd9ba8e96224430bb90c33e2483bc7ff9
Parent:        65fc562dc3fca9b0f32a4dd2654dce31bcd6842b
Author:        Bob Peterson <rpeterso@redhat.com>
AuthorDate:    Thu Aug 28 14:40:29 2008 -0500
Committer:     Bob Peterson <rpeterso@redhat.com>
CommitterDate: Thu Aug 28 14:58:49 2008 -0500

GFS2: Make gfs2_fsck accept UNLINKED metadata blocks

bz 460327

Originally, GFS2 did not use a block type of 2 in the bitmaps,
so it was considered invalid.  However, GFS2 now uses that
block type to indicate unlinked metadata blocks.  This allows
for cases where an inode is unlinked on one node while still
open on another node.  This fix changes gfs2_fsck so that it
ignores these blocks (eventually the file system will reclaim
them) rather than reporting them as errors.
---
 gfs2/fsck/pass5.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/gfs2/fsck/pass5.c b/gfs2/fsck/pass5.c
index bc4b859..030a82c 100644
--- a/gfs2/fsck/pass5.c
+++ b/gfs2/fsck/pass5.c
@@ -88,8 +88,18 @@ int check_block_status(struct gfs2_sbd *sbp, char *buffer, unsigned int buflen,
 
 		block_status = convert_mark(&q, count);
 
-		if (rg_status != block_status) {
-			const char *blockstatus[] = {"Free", "Data", "Invalid", "inode"};
+		/* If one node opens a file and another node deletes it, we
+		   may be left with a block that appears to be "unlinked" in
+		   the bitmap, but nothing links to it. This is a valid case
+		   and should be cleaned up by the file system eventually.
+		   So we ignore it. */
+		if (rg_status == GFS2_BLKST_UNLINKED &&
+		    block_status == GFS2_BLKST_FREE) {
+			log_warn("Unlinked block found at block %"
+				 PRIu64" (0x%" PRIx64 "), left unchanged.\n",
+				 block, block);
+		} else if (rg_status != block_status) {
+			const char *blockstatus[] = {"Free", "Data", "Unlinked", "inode"};
 
 			log_err("Ondisk and fsck bitmaps differ at"
 					" block %"PRIu64" (0x%" PRIx64 ") \n", block, block);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]