Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=c9c15879a9154…
Commit: c9c15879a9154620430ce36830086f14f5ca4462
Parent: 9b412e7e1c6bdbc6d3f98efc13c634b6831c7e05
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Thu Mar 3 11:21:28 2016 -0500
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Thu Mar 3 11:21:28 2016 -0500
rgmanager: Turn down log level on debug message
Only show the no resources found message when log level is set to debug.
Resolves: rhbz#1128877
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/daemons/restree.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c
index 0dc9ced..cc75719 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -587,7 +587,7 @@ do_load_resource(int ccsfd, char *base,
if (!curres) {
/* No ref and no new one inline ==
no more of the selected type */
- logt_print(LOG_WARNING, "No resources found for %s\n", base);
+ logt_print(LOG_DEBUG, "No resources found for %s\n", base);
return 1;
}
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=6dcd8a742d…
Commit: 6dcd8a742df38f4ec4dd288e83c9d917fc7a2255
Parent: 78fd0f24aae8d08c0aedad44ff83d0012d67d10b
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu May 5 11:13:29 2016 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Mon May 9 13:21:17 2016 -0500
fsck.gfs2: Fix rgrp accounting in check_n_fix_bitmap
This patch fixes function check_n_fix_bitmap for proper accounting,
especially for GFS1 file systems. It did proper accounting for
normal transitions from dinode-to-free and free-to-dinode, but it
stumbled when it did transitions from data-to-metadata and back.
This patch has the philosophy of "decrement dinode count and/or
metadata count" whenever a bit is transitioned from dinode to
something else. Likewise, it increments when a bit is transitioned
from anything else to dinode.
Signed-off-by: Bob Peterson <rpeterso(a)redhat.com>
---
gfs2/fsck/metawalk.c | 119 +++++++++++++++++++++++++-------------------------
1 files changed, 59 insertions(+), 60 deletions(-)
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 668690f..253ebcb 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -35,6 +35,7 @@ int check_n_fix_bitmap(struct gfs2_sbd *sdp, uint64_t blk, int error_on_dinode,
int old_bitmap_state;
struct rgrp_tree *rgd;
int treat_as_inode = 0;
+ int rewrite_rgrp = 0;
struct gfs_rgrp *gfs1rg;
const char *allocdesc[2][5] = { /* gfs2 descriptions */
{"free", "data", "unlinked", "inode", "reserved"},
@@ -80,75 +81,73 @@ int check_n_fix_bitmap(struct gfs2_sbd *sdp, uint64_t blk, int error_on_dinode,
data or data to dinode, no change in free space. */
gfs2_set_bitmap(rgd, blk, new_blockmap_state);
if (new_blockmap_state == GFS2_BLKST_FREE) {
- /* If we're freeing a dinode, get rid of the hash table
- entries for it. */
- if (old_bitmap_state == GFS2_BLKST_DINODE ||
- old_bitmap_state == GFS2_BLKST_UNLINKED) {
- struct dir_info *dt;
- struct inode_info *ii;
-
- dt = dirtree_find(blk);
- if (dt) {
- dirtree_delete(dt);
- treat_as_inode = 1;
- }
- ii = inodetree_find(blk);
- if (ii) {
- inodetree_delete(ii);
- treat_as_inode = 1;
- } else if (!sdp->gfs1) {
- treat_as_inode = 1;
- } else {
- /* This is a GFS1 fs (so all metadata is marked
- inode). We need to verify it is an inode
- before we can decr the rgrp inode count. */
- if (link1_type(&nlink1map, blk) == 1)
- treat_as_inode = 1;
- }
- if (old_bitmap_state == GFS2_BLKST_DINODE) {
- if (treat_as_inode && rgd->rg.rg_dinodes > 0)
- rgd->rg.rg_dinodes--;
- if (sdp->gfs1 && gfs1rg->rg_usedmeta > 0)
- gfs1rg->rg_usedmeta--;
- }
- link1_set(&nlink1map, blk, 0);
- }
rgd->rg.rg_free++;
- if (sdp->gfs1)
- gfs_rgrp_out((struct gfs_rgrp *)&rgd->rg,
- rgd->bits[0].bi_bh);
- else
- gfs2_rgrp_out_bh(&rgd->rg, rgd->bits[0].bi_bh);
+ rewrite_rgrp = 1;
} else if (old_bitmap_state == GFS2_BLKST_FREE) {
- if (new_blockmap_state == GFS2_BLKST_DINODE) {
- if (!sdp->gfs1) {
+ rgd->rg.rg_free--;
+ rewrite_rgrp = 1;
+ }
+ /* If we're freeing a dinode, get rid of the data structs for it. */
+ if (old_bitmap_state == GFS2_BLKST_DINODE ||
+ old_bitmap_state == GFS2_BLKST_UNLINKED) {
+ struct dir_info *dt;
+ struct inode_info *ii;
+
+ dt = dirtree_find(blk);
+ if (dt) {
+ dirtree_delete(dt);
+ treat_as_inode = 1;
+ }
+ ii = inodetree_find(blk);
+ if (ii) {
+ inodetree_delete(ii);
+ treat_as_inode = 1;
+ } else if (!sdp->gfs1) {
+ treat_as_inode = 1;
+ } else if (link1_type(&nlink1map, blk) == 1) {
+ /* This is a GFS1 fs (so all metadata is marked inode).
+ We need to verify it is an inode before we can decr
+ the rgrp inode count. */
+ treat_as_inode = 1;
+ }
+ if (old_bitmap_state == GFS2_BLKST_DINODE) {
+ if (treat_as_inode && rgd->rg.rg_dinodes > 0)
+ rgd->rg.rg_dinodes--;
+ else if (sdp->gfs1 && gfs1rg->rg_usedmeta > 0)
+ gfs1rg->rg_usedmeta--;
+ rewrite_rgrp = 1;
+ }
+ link1_set(&nlink1map, blk, 0);
+ } else if (new_blockmap_state == GFS2_BLKST_DINODE) {
+ if (!sdp->gfs1) {
+ treat_as_inode = 1;
+ } else {
+ /* This is GFS1 (so all metadata is marked inode). We
+ need to verify it is an inode before we can decr
+ the rgrp inode count. */
+ if (link1_type(&nlink1map, blk) == 1)
treat_as_inode = 1;
- } else {
- /* This is GFS1 (so all metadata is marked
- inode). We need to verify it is an inode
- before we can decr the rgrp inode count. */
- if (link1_type(&nlink1map, blk) == 1)
+ else {
+ struct dir_info *dt;
+ struct inode_info *ii;
+
+ dt = dirtree_find(blk);
+ if (dt)
treat_as_inode = 1;
else {
- struct dir_info *dt;
- struct inode_info *ii;
-
- dt = dirtree_find(blk);
- if (dt)
+ ii = inodetree_find(blk);
+ if (ii)
treat_as_inode = 1;
- else {
- ii = inodetree_find(blk);
- if (ii)
- treat_as_inode = 1;
- }
}
}
- if (treat_as_inode)
- rgd->rg.rg_dinodes++;
- if (sdp->gfs1)
- gfs1rg->rg_usedmeta++;
}
- rgd->rg.rg_free--;
+ if (treat_as_inode)
+ rgd->rg.rg_dinodes++;
+ else if (sdp->gfs1)
+ gfs1rg->rg_usedmeta++;
+ rewrite_rgrp = 1;
+ }
+ if (rewrite_rgrp) {
if (sdp->gfs1)
gfs_rgrp_out((struct gfs_rgrp *)&rgd->rg, rgd->bits[0].bi_bh);
else
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=78fd0f24aa…
Commit: 78fd0f24aae8d08c0aedad44ff83d0012d67d10b
Parent: 54ff2a9b67782f94e882bea708eb4c61ede1ef8d
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Wed May 4 12:38:09 2016 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Mon May 9 13:21:17 2016 -0500
fsck.gfs2: Fix rgrp dinode accounting bug
This patch fixes a bug whereby the count of dinodes in an rgrp can
get off because it's not adjusted properly when the bit is changed
from dinode to free. It's not adjusted because it's not found in
the inode tree or dirtree. The patch changes it so that the bitmap
is changed before deleting those things.
Signed-off-by: Bob Peterson <rpeterso(a)redhat.com>
---
gfs2/fsck/pass1b.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 9d5fc04..6dec193 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -347,6 +347,13 @@ static void resolve_dup_references(struct gfs2_sbd *sdp, struct duptree *dt,
if ((this_ref != ref_as_ea) &&
(inval || id->reftypecount[ref_as_data] ||
id->reftypecount[ref_as_meta])) {
+ /* Fix the bitmap first, while the inodetree
+ and dirtree entries exist. That way, the
+ bitmap_set will do proper accounting for
+ the rgrp dinode count. */
+ fsck_bitmap_set(ip, ip->i_di.di_num.no_addr,
+ _("duplicate referencing bad"),
+ GFS2_BLKST_FREE);
/* Remove the inode from the inode tree */
ii = inodetree_find(ip->i_di.di_num.no_addr);
if (ii)
@@ -356,9 +363,6 @@ static void resolve_dup_references(struct gfs2_sbd *sdp, struct duptree *dt,
dirtree_delete(di);
link1_set(&nlink1map, ip->i_di.di_num.no_addr,
0);
- fsck_bitmap_set(ip, ip->i_di.di_num.no_addr,
- _("duplicate referencing bad"),
- GFS2_BLKST_FREE);
/* We delete the dup_handler inode count and
duplicate id BEFORE clearing the metadata,
because if this is the last reference to
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=54ff2a9b67…
Commit: 54ff2a9b67782f94e882bea708eb4c61ede1ef8d
Parent: caaaeb85d04fb5f72288b7b568596ce3e9ca5e8e
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Tue May 3 12:16:05 2016 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Mon May 9 13:21:17 2016 -0500
fsck.gfs2: pass1b is too noisy wrt gfs1 non-dinode metadata
For GFS1 file systems, a block marked as metadata may either be a
dinode or any other kind of metadata. For GFS2 file systems, it makes
sense to complain when we find something that we think is a dinode,
but isn't. For GFS1 file systems, non-dinode metadata is a common
thing, so it makes sense to keep quiet about it.
Signed-off-by: Bob Peterson <rpeterso(a)redhat.com>
---
gfs2/fsck/pass1b.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index f5f286a..9d5fc04 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -877,9 +877,10 @@ static int find_block_ref(struct gfs2_sbd *sdp, uint64_t inode)
/* double-check the meta header just to be sure it's metadata */
if (ip->i_di.di_header.mh_magic != GFS2_MAGIC ||
ip->i_di.di_header.mh_type != GFS2_METATYPE_DI) {
- log_debug( _("Block %lld (0x%llx) is not gfs2 metadata.\n"),
- (unsigned long long)inode,
- (unsigned long long)inode);
+ if (!sdp->gfs1)
+ log_debug( _("Block %lld (0x%llx) is not a dinode.\n"),
+ (unsigned long long)inode,
+ (unsigned long long)inode);
error = 1;
goto out;
}
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=ef8592b611…
Commit: ef8592b611c776b75d037a4c5bb3cf0779f2b55b
Parent: 120b0bfdca68602205623dd85516b87bd98a692d
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Mon May 2 13:44:42 2016 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Mon May 9 13:21:17 2016 -0500
fsck.gfs2: Adjust bitmap for lost+found after adding to dirtree
This patch changes the order in which things are done in function
make_sure_lf_exists. Before, it was setting the bitmap and then
adding lost+found to the directory tree. Now the order is reversed:
lost+found is added to the directory tree, then the bitmap is
twiddled. Doing it in this order ensures that the block is treated
as an inode block for the purposes of adjusting the rgrp counts.
This is only a problem for GFS1 file systems where a bitmap
designation might mean either dinode or other metadata.
Signed-off-by: Bob Peterson <rpeterso(a)redhat.com>
---
gfs2/fsck/lost_n_found.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/gfs2/fsck/lost_n_found.c b/gfs2/fsck/lost_n_found.c
index 197ae7d..bd05223 100644
--- a/gfs2/fsck/lost_n_found.c
+++ b/gfs2/fsck/lost_n_found.c
@@ -139,9 +139,12 @@ void make_sure_lf_exists(struct gfs2_inode *ip)
/* FIXME: i'd feel better about this if fs_mkdir returned
whether it created a new directory or just found an old one,
and we used that instead of the bitmap_type to run this */
+ dirtree_insert(lf_dip->i_di.di_num);
+ /* Set the bitmap AFTER the dirtree insert so that function
+ check_n_fix_bitmap will realize it's a dinode and adjust
+ the rgrp counts properly. */
fsck_bitmap_set(ip, lf_dip->i_di.di_num.no_addr,
_("lost+found dinode"), GFS2_BLKST_DINODE);
- dirtree_insert(lf_dip->i_di.di_num);
/* root inode links to lost+found */
incr_link_count(sdp->md.rooti->i_di.di_num, lf_dip, _("root"));
/* lost+found link for '.' from itself */