public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* STABLE2 - GFS2: Make gfs2_fsck accept UNLINKED metadata blocks
@ 2008-08-28 20:02 Bob Peterson
  0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2008-08-28 20:02 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=75695e0c5cdd2511aef1b52a46dbf69ff95869dc
Commit:        75695e0c5cdd2511aef1b52a46dbf69ff95869dc
Parent:        78722d4068c7f2810a43615c69591e9e6fb9b9a4
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:55:20 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 28d37e3..2a2cf4e 100644
--- a/gfs2/fsck/pass5.c
+++ b/gfs2/fsck/pass5.c
@@ -75,8 +75,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);


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

only message in thread, other threads:[~2008-08-28 19:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-28 20:02 STABLE2 - GFS2: Make gfs2_fsck accept UNLINKED metadata blocks 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).