From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [Patch 20/44] fsck.gfs2: Add duplicate reference processing for leaf blocks
Date: Thu, 11 Aug 2011 17:07:14 -0400 (EDT) [thread overview]
Message-ID: <941714151.544757.1313096834556.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> (raw)
From 3183f07e29fdc7c8af817ea97740b472f4767fc3 Mon Sep 17 00:00:00 2001
From: Bob Peterson <rpeterso@redhat.com>
Date: Tue, 9 Aug 2011 09:33:08 -0500
Subject: [PATCH 20/44] fsck.gfs2: Add duplicate reference processing for leaf
blocks
This patch adds checks for duplicate block references to the leaf block
processing.
rhbz#675723
---
gfs2/fsck/pass1.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 8e6bec3..4ea9f69 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -330,7 +330,27 @@ static int check_num_ptrs(struct gfs2_inode *ip, uint64_t leafno,
static int check_leaf(struct gfs2_inode *ip, uint64_t block, void *private)
{
struct block_count *bc = (struct block_count *) private;
+ uint8_t q;
+ /* Note if we've gotten this far, the block has already passed the
+ check in metawalk: gfs2_check_meta(lbh, GFS2_METATYPE_LF).
+ So we know it's a leaf block. */
+ q = block_type(block);
+ if (q != gfs2_block_free) {
+ log_err( _("Found duplicate block %llu (0x%llx) referenced "
+ "as a directory leaf in dinode "
+ "%llu (0x%llx) - was marked %d (%s)\n"),
+ (unsigned long long)block,
+ (unsigned long long)block,
+ (unsigned long long)ip->i_di.di_num.no_addr,
+ (unsigned long long)ip->i_di.di_num.no_addr, q,
+ block_type_string(q));
+ add_duplicate_ref(ip, block, ref_as_meta, 0, INODE_VALID);
+ if (q == gfs2_leaf_blk) /* If the previous reference also saw
+ this as a leaf, it was already
+ checked, so don't check again. */
+ return -EEXIST;
+ }
fsck_blockmap_set(ip, block, _("directory leaf"), gfs2_leaf_blk);
bc->indir_count++;
return 0;
--
1.7.4.4
reply other threads:[~2011-08-11 21:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=941714151.544757.1313096834556.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com \
--to=rpeterso@redhat.com \
/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 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 NNTP newsgroup(s).