From mboxrd@z Thu Jan 1 00:00:00 1970 From: rpeterso@redhat.com Date: Fri, 20 Jan 2012 09:09:59 -0600 Subject: [Cluster-devel] [PATCH 18/66] fsck.gfs2: fsck.gfs2: Find and clear duplicate leaf blocks refs In-Reply-To: <1327072247-26275-1-git-send-email-rpeterso@redhat.com> References: <1327072247-26275-1-git-send-email-rpeterso@redhat.com> Message-ID: <1327072247-26275-19-git-send-email-rpeterso@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit From: Bob Peterson Duplicate references that were in leaf blocks were never found nor cleared. This patch adds that capability. rhbz#675723 --- gfs2/fsck/pass1b.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c index ce358c4..65e6de9 100644 --- a/gfs2/fsck/pass1b.c +++ b/gfs2/fsck/pass1b.c @@ -26,6 +26,7 @@ struct dup_handler { int ref_count; }; +static int check_leaf(struct gfs2_inode *ip, uint64_t block, void *private); static int check_metalist(struct gfs2_inode *ip, uint64_t block, struct gfs2_buffer_head **bh, int h, void *private); static int check_data(struct gfs2_inode *ip, uint64_t block, void *private); @@ -51,7 +52,7 @@ static int find_dentry(struct gfs2_inode *ip, struct gfs2_dirent *de, struct metawalk_fxns find_refs = { .private = NULL, - .check_leaf = NULL, + .check_leaf = check_leaf, .check_metalist = check_metalist, .check_data = check_data, .check_eattr_indir = check_eattr_indir, @@ -73,6 +74,11 @@ struct metawalk_fxns find_dirents = { .check_eattr_extentry = NULL, }; +static int check_leaf(struct gfs2_inode *ip, uint64_t block, void *private) +{ + return add_duplicate_ref(ip, block, ref_as_meta, 1, INODE_VALID); +} + static int check_metalist(struct gfs2_inode *ip, uint64_t block, struct gfs2_buffer_head **bh, int h, void *private) { @@ -250,6 +256,11 @@ static int clear_dup_data(struct gfs2_inode *ip, uint64_t block, void *private) return clear_dup_metalist(ip, block, NULL, 0, private); } +static int clear_leaf(struct gfs2_inode *ip, uint64_t block, void *private) +{ + return clear_dup_metalist(ip, block, NULL, 0, private); +} + static int clear_dup_eattr_indir(struct gfs2_inode *ip, uint64_t block, uint64_t parent, struct gfs2_buffer_head **bh, void *private) @@ -392,7 +403,7 @@ static int clear_a_reference(struct gfs2_sbd *sdp, struct duptree *b, osi_list_t *tmp, *x; struct metawalk_fxns clear_dup_fxns = { .private = NULL, - .check_leaf = NULL, + .check_leaf = clear_leaf, .check_metalist = clear_dup_metalist, .check_data = clear_dup_data, .check_eattr_indir = clear_dup_eattr_indir, -- 1.7.7.5