From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4819 invoked by alias); 28 Aug 2008 19:59:49 -0000 Received: (qmail 4810 invoked by alias); 28 Aug 2008 19:59:49 -0000 X-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,KAM_MX,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on bastion.fedora.phx.redhat.com X-Spam-Level: Subject: STABLE2 - GFS2: Make gfs2_fsck accept UNLINKED metadata blocks To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE2 X-Git-Reftype: branch X-Git-Oldrev: 78722d4068c7f2810a43615c69591e9e6fb9b9a4 X-Git-Newrev: 75695e0c5cdd2511aef1b52a46dbf69ff95869dc From: Bob Peterson Message-Id: <20080828195842.EA2C5120379@lists.fedorahosted.org> Date: Thu, 28 Aug 2008 20:02:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2008-q3/txt/msg00355.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=75695e0c5cdd2511aef1b52a46dbf69ff95869dc Commit: 75695e0c5cdd2511aef1b52a46dbf69ff95869dc Parent: 78722d4068c7f2810a43615c69591e9e6fb9b9a4 Author: Bob Peterson AuthorDate: Thu Aug 28 14:40:29 2008 -0500 Committer: Bob Peterson 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);