cluster: RHEL510 - fsck.gfs2: Rearrange block types to group all inode types
Bob Peterson
rpeterso at fedoraproject.org
Fri Apr 5 13:46:27 UTC 2013
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=071287645c85a40797d2658d4e0f6cc3a65cf93f
Commit: 071287645c85a40797d2658d4e0f6cc3a65cf93f
Parent: 979447cfad1f18bbcf617511ae40742903690fdf
Author: Bob Peterson <rpeterso at redhat.com>
AuthorDate: Thu Jan 12 13:55:59 2012 -0600
Committer: Bob Peterson <rpeterso at redhat.com>
CommitterDate: Fri Apr 5 06:25:01 2013 -0700
fsck.gfs2: Rearrange block types to group all inode types
This patch rearranges the declares in util.h such that all the inode
types are grouped together. There's a place in fsck.gfs2 that checks
whether a block is an inode by checking the range of block types.
But that's only valid if they are all grouped together. Since a
previous patch put GFS journaled data blocks in the range, they could
mistakenly pass that test and be treated as an inode for that test.
I never saw an error resulting from this mistake, but I'm fixing it
anyway.
rhbz#877150
Conflicts:
gfs2/fsck/util.h
---
gfs2/fsck/util.h | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/gfs2/fsck/util.h b/gfs2/fsck/util.h
index 86bda82..e4bee0a 100644
--- a/gfs2/fsck/util.h
+++ b/gfs2/fsck/util.h
@@ -52,16 +52,18 @@ enum gfs2_mark_block {
gfs2_block_free = (0x0),
gfs2_block_used = (0x1),
gfs2_indir_blk = (0x2),
+ /* These are inode block types (only): */
gfs2_inode_dir = (0x3),
gfs2_inode_file = (0x4),
gfs2_inode_lnk = (0x5),
- gfs2_inode_device = (0x6),
+ gfs2_inode_device = (0x6), /* char or block device */
+ gfs2_inode_fifo = (0x7),
+ gfs2_inode_sock = (0x8),
+ gfs2_inode_invalid = (0x9),
- gfs2_inode_fifo = (0x8),
- gfs2_inode_sock = (0x9),
-
- gfs2_inode_invalid = (0xa),
+ /* misc block types: */
+ gfs2_jdata = (0xa), /* gfs journaled data blocks */
gfs2_meta_inval = (0xb),
gfs2_leaf_blk = (0xc),
@@ -81,11 +83,11 @@ static const inline char *block_type_string(uint8_t q)
"symlink",
"device",
- "",
"fifo",
"socket",
-
"invalid inode",
+
+ "journaled data",
"invalid meta",
"dir leaf",
"",
@@ -110,11 +112,11 @@ static inline int blockmap_to_bitmap(enum gfs2_mark_block m)
GFS2_BLKST_DINODE, /* symlink */
GFS2_BLKST_DINODE, /* block or char device */
- GFS2_BLKST_USED, /* journaled data */
GFS2_BLKST_DINODE, /* fifo */
GFS2_BLKST_DINODE, /* socket */
-
GFS2_BLKST_FREE, /* invalid inode */
+
+ GFS2_BLKST_USED, /* journaled data */
GFS2_BLKST_FREE, /* invalid meta */
GFS2_BLKST_USED, /* dir leaf */
GFS2_BLKST_UNLINKED, /* GFS unlinked metadata */
More information about the cluster-commits
mailing list