[gfs2-utils] 03/03: gfs2-utils: Wrong hash value used to clean
journals
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch RHEL8
in repository gfs2-utils.
commit 7095c5f1ab7ab2d9e02c203c9966b65c09249e1f
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri Dec 14 09:16:19 2018 -0500
gfs2-utils: Wrong hash value used to clean journals
When fsck.gfs2 sees a dirty journal, (one that does not have a
log header with the UNMOUNT flag set at the wrap-point), it replays
the journal and writes a log header out to "clean" the journal.
Unfortunately, before this patch, it was using the wrong hash value.
So every time fsck.gfs2 was run, it would not recognize its own
log header because of the wrong hash, and therefore it would always
see the journal as dirty with every run (until the file system is
mounted and unmounted, which would write a new correct log header).
Therefore, multiple runs of fsck.gfs2 would always result in a
replay of the journal, which remains "dirty."
This patch changes function clean_journal so that it uses the
correct hash function. Therefore, the journal will be truly clean
and consecutive runs (or mounts) will find the journal clean.
Resolves: rhbz#1659490
Signed-off-by: Bob Peterson <rpeterso(a)redhat.com>
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/recovery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gfs2/libgfs2/recovery.c b/gfs2/libgfs2/recovery.c
index 6b14bf9..06f8111 100644
--- a/gfs2/libgfs2/recovery.c
+++ b/gfs2/libgfs2/recovery.c
@@ -241,7 +241,7 @@ int clean_journal(struct gfs2_inode *ip, struct gfs2_log_header *head)
lh->lh_sequence = cpu_to_be64(head->lh_sequence + 1);
lh->lh_flags = cpu_to_be32(GFS2_LOG_HEAD_UNMOUNT);
lh->lh_blkno = cpu_to_be32(lblock);
- hash = gfs2_disk_hash((const char *)lh, sizeof(struct gfs2_log_header));
+ hash = lgfs2_log_header_hash(bh->b_data);
lh->lh_hash = cpu_to_be32(hash);
bmodified(bh);
brelse(bh);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[gfs2-utils] 02/03: libgfs2: Fix pointer cast byte order issue
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch RHEL8
in repository gfs2-utils.
commit c834266db69d3eed9e829a6831b27cb61531dfb3
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Thu Sep 6 14:28:19 2018 +0100
libgfs2: Fix pointer cast byte order issue
lgfs2_field_assign() currently uses pointer casting to achieve generic
integer assignment based on the width of the field, but this is broken
as a uin32_t field can be assigned the value from the high bytes of the
uint64_t value, for instance. To fix this, store the value into a
uint64_t before casting to the narrower types.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/meta.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gfs2/libgfs2/meta.c b/gfs2/libgfs2/meta.c
index a828946..e0ea491 100644
--- a/gfs2/libgfs2/meta.c
+++ b/gfs2/libgfs2/meta.c
@@ -940,6 +940,7 @@ int lgfs2_field_str(char *str, const size_t size, const char *blk, const struct
int lgfs2_field_assign(char *blk, const struct lgfs2_metafield *field, const void *val)
{
char *fieldp = blk + field->offset;
+ uint64_t num = *(uint64_t *)val;
if (field->flags & LGFS2_MFF_UUID) {
memcpy(fieldp, val, 16);
@@ -959,16 +960,16 @@ int lgfs2_field_assign(char *blk, const struct lgfs2_metafield *field, const voi
switch(field->length) {
case sizeof(uint8_t):
- *fieldp = *(uint8_t *)val;
+ *fieldp = (uint8_t)num;
return 0;
case sizeof(uint16_t):
- *(uint16_t *)fieldp = cpu_to_be16(*(uint16_t *)val);
+ *(uint16_t *)fieldp = cpu_to_be16((uint16_t)num);
return 0;
case sizeof(uint32_t):
- *(uint32_t *)fieldp = cpu_to_be32(*(uint32_t *)val);
+ *(uint32_t *)fieldp = cpu_to_be32((uint32_t)num);
return 0;
case sizeof(uint64_t):
- *(uint64_t *)fieldp = cpu_to_be64(*(uint64_t *)val);
+ *(uint64_t *)fieldp = cpu_to_be64((uint64_t)num);
return 0;
default:
/* Will never happen */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[gfs2-utils] 01/03: fsck.gfs2: Don't check fs formats we don't
recognise
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch RHEL8
in repository gfs2-utils.
commit c7f461428820b01966f5d3ba60a4c0bc8d22a208
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Fri Aug 17 12:49:24 2018 +0100
fsck.gfs2: Don't check fs formats we don't recognise
Currently fsck.gfs2 will ignore sb_fs_format but in order to support
future formats we need to make sure it doesn't try to check filesystems
with formats we don't recognise yet. Better late than never.
Tests included.
rhbz#1616389
rhbz#1622050
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/fsck.h | 2 ++
gfs2/fsck/initialize.c | 17 ++++++++++++-----
gfs2/libgfs2/super.c | 7 +++++++
tests/fsck.at | 13 +++++++++++++
4 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h
index d3f7635..877448c 100644
--- a/gfs2/fsck/fsck.h
+++ b/gfs2/fsck/fsck.h
@@ -4,6 +4,8 @@
#include "libgfs2.h"
#include "osi_tree.h"
+#define FSCK_MAX_FORMAT (1801)
+
#define FSCK_HASH_SHIFT (13)
#define FSCK_HASH_SIZE (1 << FSCK_HASH_SHIFT)
#define FSCK_HASH_MASK (FSCK_HASH_SIZE - 1)
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index ebe62b9..d1c620a 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -1334,12 +1334,12 @@ static int fill_super_block(struct gfs2_sbd *sdp)
if (sizeof(struct gfs2_sb) > sdp->sd_sb.sb_bsize){
log_crit( _("GFS superblock is larger than the blocksize!\n"));
log_debug("sizeof(struct gfs2_sb) > sdp->sd_sb.sb_bsize\n");
- return -1;
+ return FSCK_ERROR;
}
if (compute_constants(sdp)) {
log_crit("%s\n", _("Failed to compute file system constants"));
- exit(FSCK_ERROR);
+ return FSCK_ERROR;
}
ret = read_sb(sdp);
if (ret < 0) {
@@ -1348,10 +1348,15 @@ static int fill_super_block(struct gfs2_sbd *sdp)
/* Now that we've tried to repair it, re-read it. */
ret = read_sb(sdp);
if (ret < 0)
- return -1;
+ return FSCK_ERROR;
}
if (sdp->gfs1)
sbd1 = (struct gfs_sb *)&sdp->sd_sb;
+ else if (sdp->sd_sb.sb_fs_format > FSCK_MAX_FORMAT) {
+ log_crit(_("Unsupported gfs2 format found: %"PRIu32"\n"), sdp->sd_sb.sb_fs_format);
+ log_crit(_("A newer fsck.gfs2 is required to check this file system.\n"));
+ return FSCK_USAGE;
+ }
return 0;
}
@@ -1556,6 +1561,7 @@ int initialize(struct gfs2_sbd *sdp, int force_check, int preen,
int *all_clean)
{
int clean_journals = 0, open_flag;
+ int err;
*all_clean = 0;
@@ -1601,8 +1607,9 @@ int initialize(struct gfs2_sbd *sdp, int force_check, int preen,
}
/* read in sb from disk */
- if (fill_super_block(sdp))
- return FSCK_ERROR;
+ err = fill_super_block(sdp);
+ if (err != FSCK_OK)
+ return err;
/* Change lock protocol to be fsck_* instead of lock_* */
if (!opts.no && preen_is_safe(sdp, preen, force_check)) {
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index 6e7d8c2..7592564 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -29,11 +29,18 @@ int check_sb(struct gfs2_sb *sb)
errno = EIO;
return -1;
}
+ /* Check for gfs1 */
if (sb->sb_fs_format == GFS_FORMAT_FS &&
sb->sb_header.mh_format == GFS_FORMAT_SB &&
sb->sb_multihost_format == GFS_FORMAT_MULTI) {
return 1;
}
+ /* It's gfs2. Check format number is in a sensible range. */
+ if (sb->sb_fs_format < GFS2_FORMAT_FS ||
+ sb->sb_fs_format > 1899) {
+ errno = EINVAL;
+ return -1;
+ }
return 2;
}
diff --git a/tests/fsck.at b/tests/fsck.at
index 39a04d0..97a00a9 100644
--- a/tests/fsck.at
+++ b/tests/fsck.at
@@ -54,3 +54,16 @@ AT_CHECK([gfs2_edit -p journal0 field di_header.mh_magic 0 $GFS_TGT], 0, [ignore
AT_CHECK([fsck.gfs2 -y $GFS_TGT], 1, [ignore], [ignore])
AT_CHECK([fsck.gfs2 -n $GFS_TGT], 0, [ignore], [ignore])
AT_CLEANUP
+
+AT_SETUP([gfs2 format versions])
+AT_KEYWORDS(fsck.gfs2 fsck)
+GFS_TGT_REGEN
+AT_CHECK([mkfs.gfs2 -O -p lock_nolock ${GFS_TGT}], 0, [ignore], [ignore])
+AT_CHECK([echo "set sb { sb_fs_format: 1802 }" | gfs2l ${GFS_TGT}], 0, [ignore], [ignore])
+# Unsupported format, FSCK_USAGE == 16
+AT_CHECK([fsck.gfs2 -y $GFS_TGT], 16, [ignore], [ignore])
+# Format out of range
+AT_CHECK([echo "set sb { sb_fs_format: 4242 }" | gfs2l ${GFS_TGT}], 0, [ignore], [ignore])
+AT_CHECK([fsck.gfs2 -y $GFS_TGT], 1, [ignore], [ignore])
+AT_CHECK([fsck.gfs2 -n $GFS_TGT], 0, [ignore], [ignore])
+AT_CLEANUP
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[gfs2-utils] 02/02: fsck.gfs2: Disambiguate check_metalist
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit c6e0df5f096995d41d1bea3a86ba7f66db72abf2
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Fri Jun 14 11:41:03 2019 +0100
fsck.gfs2: Disambiguate check_metalist
Rename to pass1_check_metalist
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/pass1.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 22db60d..442734b 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -39,7 +39,7 @@ struct block_count {
};
static int p1check_leaf(struct gfs2_inode *ip, uint64_t block, void *private);
-static int check_metalist(struct gfs2_inode *ip, uint64_t block,
+static int pass1_check_metalist(struct gfs2_inode *ip, uint64_t block,
struct gfs2_buffer_head **bh, int h, int *is_valid,
int *was_duplicate, void *private);
static int undo_check_metalist(struct gfs2_inode *ip, uint64_t block,
@@ -191,7 +191,7 @@ out:
struct metawalk_fxns pass1_fxns = {
.private = NULL,
.check_leaf = p1check_leaf,
- .check_metalist = check_metalist,
+ .check_metalist = pass1_check_metalist,
.check_data = pass1_check_data,
.check_eattr_indir = check_eattr_indir,
.check_eattr_leaf = check_eattr_leaf,
@@ -344,7 +344,7 @@ static int p1check_leaf(struct gfs2_inode *ip, uint64_t block, void *private)
return 0;
}
-static int check_metalist(struct gfs2_inode *ip, uint64_t block,
+static int pass1_check_metalist(struct gfs2_inode *ip, uint64_t block,
struct gfs2_buffer_head **bh, int h, int *is_valid,
int *was_duplicate, void *private)
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[gfs2-utils] 01/02: gfs2-utils: Accept a char* instead of a buffer
head in gfs2_check_meta
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 4e328af777a8cdfdae42de2ef482776e16489d54
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Jan 28 15:50:51 2019 +0000
gfs2-utils: Accept a char* instead of a buffer head in gfs2_check_meta
This allows us to call it from different contexts.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 6 +++---
gfs2/edit/hexedit.c | 6 +++---
gfs2/edit/savemeta.c | 2 +-
gfs2/fsck/fs_recovery.c | 6 +++---
gfs2/fsck/initialize.c | 6 +++---
gfs2/fsck/metawalk.c | 10 +++++-----
gfs2/fsck/pass1.c | 12 ++++++------
gfs2/fsck/pass2.c | 8 ++++----
gfs2/fsck/pass5.c | 2 +-
gfs2/fsck/rgrepair.c | 10 +++++-----
gfs2/libgfs2/fs_ops.c | 6 +++---
gfs2/libgfs2/libgfs2.h | 2 +-
gfs2/libgfs2/rgrp.c | 2 +-
gfs2/libgfs2/structures.c | 6 +++---
gfs2/libgfs2/super.c | 2 +-
15 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 9cf97b6..17217ce 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -836,7 +836,7 @@ static int fix_xattr(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, struct g
/* Read in the i_di.di_eattr block */
eabh = bread(sbp, ip->i_di.di_eattr);
- if (!gfs2_check_meta(eabh, GFS_METATYPE_IN)) {/* if it is an indirect block */
+ if (!gfs2_check_meta(eabh->b_data, GFS_METATYPE_IN)) {/* if it is an indirect block */
len = sbp->bsize - sizeof(struct gfs_indirect);
buf = malloc(len);
if (!buf) {
@@ -1012,7 +1012,7 @@ static int next_rg_metatype(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
return -1;
bh = bread(sdp, *block);
first = 0;
- } while(gfs2_check_meta(bh, type));
+ } while(gfs2_check_meta(bh->b_data, type));
brelse(bh);
return 0;
}
@@ -1072,7 +1072,7 @@ static int inode_renumber(struct gfs2_sbd *sbp, uint64_t root_inode_addr, osi_li
sbp->sd_sb.sb_root_dir.no_formal_ino = sbp->md.next_inum;
}
bh = bread(sbp, block);
- if (!gfs2_check_meta(bh, GFS_METATYPE_DI)) {/* if it is an dinode */
+ if (!gfs2_check_meta(bh->b_data, GFS_METATYPE_DI)) {/* if it is an dinode */
/* Skip the rindex and jindex inodes for now. */
if (block != rindex_addr && block != jindex_addr) {
error = adjust_inode(sbp, bh);
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index f015828..655afc5 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1275,7 +1275,7 @@ static int find_rg_metatype(struct rgrp_tree *rgd, uint64_t *blk, uint64_t start
for (j = 0; j < m; j++) {
*blk = ibuf[j];
bhp = bread(&sbd, *blk);
- found = (*blk > startblk) && !gfs2_check_meta(bhp, mtype);
+ found = (*blk > startblk) && !gfs2_check_meta(bhp->b_data, mtype);
brelse(bhp);
if (found) {
free(ibuf);
@@ -2280,7 +2280,7 @@ static int count_dinode_blks(struct rgrp_tree *rgd, int bitmap,
rgd->bits[bitmap].bi_start + b);
byte = rbh->b_data + off + (b / GFS2_NBBY);
bit = (b % GFS2_NBBY) * GFS2_BIT_SIZE;
- if (gfs2_check_meta(tbh, GFS2_METATYPE_DI) == 0) {
+ if (gfs2_check_meta(tbh->b_data, GFS2_METATYPE_DI) == 0) {
dinodes++;
new_state = GFS2_BLKST_DINODE;
} else {
@@ -2351,7 +2351,7 @@ static void rg_repair(void)
printf("Bitmap #%d:", b);
rbh = bread(&sbd, rgd->ri.ri_addr + b);
- if (gfs2_check_meta(rbh, mtype)) { /* wrong type */
+ if (gfs2_check_meta(rbh->b_data, mtype)) { /* wrong type */
printf("Damaged. Repairing...");
/* Fix the meta header */
memset(rbh->b_data, 0, sbd.bsize);
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 04f1221..18432b7 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -567,7 +567,7 @@ static int save_leaf_chain(struct metafd *mfd, struct gfs2_sbd *sdp, uint64_t bl
return 1;
}
warm_fuzzy_stuff(blk, FALSE);
- if (gfs2_check_meta(bh, GFS2_METATYPE_LF) == 0) {
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_LF) == 0) {
int ret = save_bh(mfd, bh, blk, NULL);
if (ret != 0) {
brelse(bh);
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 677abd7..4c0932b 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -211,7 +211,7 @@ static int revoke_lo_scan_elements(struct gfs2_inode *ip, unsigned int start,
return error;
if (!first) {
- if (gfs2_check_meta(bh, GFS2_METATYPE_LB))
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_LB))
continue;
}
while (offset + sizeof(uint64_t) <= sdp->sd_sb.sb_bsize) {
@@ -355,7 +355,7 @@ static int foreach_descriptor(struct gfs2_inode *ip, unsigned int start,
bmodified(bh);
brelse(bh);
return error;
- } else if (gfs2_check_meta(bh, GFS2_METATYPE_LD)) {
+ } else if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_LD)) {
bmodified(bh);
brelse(bh);
return -EIO;
@@ -649,7 +649,7 @@ static int rangecheck_jmeta(struct gfs2_inode *ip, uint64_t block,
rc = rangecheck_jblock(ip, block);
if (rc == meta_is_good) {
*bh = bread(ip->i_sbd, block);
- *is_valid = (gfs2_check_meta(*bh, GFS2_METATYPE_IN) == 0);
+ *is_valid = (gfs2_check_meta((*bh)->b_data, GFS2_METATYPE_IN) == 0);
if (!(*is_valid)) {
log_err( _("Journal at block %lld (0x%llx) has a bad "
"indirect block pointer %lld (0x%llx) "
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index d1c620a..ed6954d 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -243,7 +243,7 @@ static void check_rgrp_integrity(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
if (state == GFS2_BLKST_DINODE) {
if (sdp->gfs1) {
bh = bread(sdp, diblock);
- if (!gfs2_check_meta(bh,
+ if (!gfs2_check_meta(bh->b_data,
GFS2_METATYPE_DI))
rg_useddi++;
else
@@ -298,7 +298,7 @@ static void check_rgrp_integrity(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
(unsigned long long)diblock,
(unsigned long long)diblock);
bh = bread(sdp, diblock);
- if (!gfs2_check_meta(bh, GFS2_METATYPE_DI)) {
+ if (!gfs2_check_meta(bh->b_data, GFS2_METATYPE_DI)) {
struct gfs2_inode *ip =
fsck_inode_get(sdp, rgd, bh);
if (ip->i_di.di_blocks > 1) {
@@ -1171,7 +1171,7 @@ static int peruse_metadata(struct gfs2_sbd *sdp, uint64_t startblock)
/* Max RG size is 2GB. 2G / bsize. */
for (blk = startblock; blk < startblock + max_rg_size; blk++) {
bh = bread(sdp, blk);
- if (gfs2_check_meta(bh, GFS2_METATYPE_DI)) {
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_DI)) {
brelse(bh);
continue;
}
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 118e6f3..d256dd2 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -560,7 +560,7 @@ int check_leaf(struct gfs2_inode *ip, int lindex, struct metawalk_fxns *pass,
/* Try to read in the leaf block. */
lbh = bread(sdp, *leaf_no);
/* Make sure it's really a valid leaf block. */
- if (gfs2_check_meta(lbh, GFS2_METATYPE_LF)) {
+ if (gfs2_check_meta(lbh->b_data, GFS2_METATYPE_LF)) {
msg = _("that is not really a leaf");
goto bad_leaf;
}
@@ -771,7 +771,7 @@ int check_leaf_blks(struct gfs2_inode *ip, struct metawalk_fxns *pass)
if (valid_block_ip(ip, leaf_no)) {
lbh = bread(sdp, leaf_no);
/* Make sure it's really a valid leaf block. */
- if (gfs2_check_meta(lbh, GFS2_METATYPE_LF) == 0) {
+ if (gfs2_check_meta(lbh->b_data, GFS2_METATYPE_LF) == 0) {
brelse(lbh);
first_ok_leaf = leaf_no;
break;
@@ -1271,7 +1271,7 @@ static int build_and_check_metalist(struct gfs2_inode *ip, osi_list_t *mlp,
for (tmp = prev_list->next; tmp != prev_list; tmp = tmp->next){
bh = osi_list_entry(tmp, struct gfs2_buffer_head,
b_altlist);
- if (gfs2_check_meta(bh, iblk_type)) {
+ if (gfs2_check_meta(bh->b_data, iblk_type)) {
if (pass->invalid_meta_is_fatal)
return meta_error;
@@ -1515,7 +1515,7 @@ static int undo_check_data(struct gfs2_inode *ip, struct metawalk_fxns *pass,
static int hdr_size(struct gfs2_buffer_head *bh, int height)
{
if (height > 1) {
- if (gfs2_check_meta(bh, GFS2_METATYPE_IN))
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_IN))
return 0;
if (bh->sdp->gfs1)
return sizeof(struct gfs_indirect);
@@ -1523,7 +1523,7 @@ static int hdr_size(struct gfs2_buffer_head *bh, int height)
return sizeof(struct gfs2_meta_header);
}
/* if this isn't really a dinode, skip it */
- if (gfs2_check_meta(bh, GFS2_METATYPE_DI))
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_DI))
return 0;
return sizeof(struct gfs2_dinode);
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 24a6498..22db60d 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -393,7 +393,7 @@ static int check_metalist(struct gfs2_inode *ip, uint64_t block,
}
nbh = bread(ip->i_sbd, block);
- *is_valid = (gfs2_check_meta(nbh, iblk_type) == 0);
+ *is_valid = (gfs2_check_meta(nbh->b_data, iblk_type) == 0);
if (!(*is_valid)) {
log_err( _("Inode %lld (0x%llx) has a bad indirect block "
@@ -519,7 +519,7 @@ static int blockmap_set_as_data(struct gfs2_inode *ip, uint64_t block)
/* The bitmap says it's a dinode, but a block reference begs to differ.
So which is it? */
bh = bread(ip->i_sbd, block);
- if (gfs2_check_meta(bh, GFS2_METATYPE_DI) != 0)
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_DI) != 0)
goto out;
/* The meta header agrees it's a dinode. But it might be data in
@@ -747,7 +747,7 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect,
handling sort it out. If it isn't, clear it but don't
count it as a duplicate. */
*bh = bread(sdp, indirect);
- if (gfs2_check_meta(*bh, GFS2_METATYPE_IN)) {
+ if (gfs2_check_meta((*bh)->b_data, GFS2_METATYPE_IN)) {
bc->ea_count++;
if (q != GFS2_BLKST_FREE) { /* Duplicate? */
add_duplicate_ref(ip, indirect, ref_as_ea, 0,
@@ -829,7 +829,7 @@ static int check_ealeaf_block(struct gfs2_inode *ip, uint64_t block, int btype,
really is an EA. If it is, let duplicate handling sort it out.
If it isn't, clear it but don't count it as a duplicate. */
leaf_bh = bread(sdp, block);
- if (gfs2_check_meta(leaf_bh, btype)) {
+ if (gfs2_check_meta(leaf_bh->b_data, btype)) {
bc->ea_count++;
if (q != GFS2_BLKST_FREE) { /* Duplicate? */
add_duplicate_ref(ip, block, ref_as_ea, 0,
@@ -1666,7 +1666,7 @@ static int check_system_inode(struct gfs2_sbd *sdp,
" (0x%llx)\n"), filename,
(unsigned long long)iblock,
(unsigned long long)iblock);
- if (gfs2_check_meta((*sysinode)->i_bh, GFS2_METATYPE_DI)) {
+ if (gfs2_check_meta((*sysinode)->i_bh->b_data, GFS2_METATYPE_DI)) {
log_err( _("Found invalid system dinode at block #"
"%llu (0x%llx)\n"),
(unsigned long long)iblock,
@@ -1935,7 +1935,7 @@ static int pass1_process_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd, uin
bh = bread(sdp, block);
is_inode = 0;
- if (gfs2_check_meta(bh, GFS2_METATYPE_DI) == 0)
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_DI) == 0)
is_inode = 1;
check_magic = ((struct gfs2_meta_header *)
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 763e39a..0a54c9b 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -651,7 +651,7 @@ static int basic_dentry_checks(struct gfs2_inode *ip, struct gfs2_dirent *dent,
struct gfs2_buffer_head *tbh;
tbh = bread(sdp, entry->no_addr);
- if (gfs2_check_meta(tbh, GFS2_METATYPE_DI)) { /* not dinode */
+ if (gfs2_check_meta(tbh->b_data, GFS2_METATYPE_DI)) { /* not dinode */
log_err( _("Directory entry '%s' pointing to block "
"%llu (0x%llx) in directory %llu (0x%llx) "
"is not really a GFS1 dinode.\n"), tmp_name,
@@ -1600,7 +1600,7 @@ static int check_hash_tbl_dups(struct gfs2_inode *ip, uint64_t *tbl,
continue;
lbh = bread(ip->i_sbd, leafblk);
- if (gfs2_check_meta(lbh, GFS2_METATYPE_LF)) { /* Chked later */
+ if (gfs2_check_meta(lbh->b_data, GFS2_METATYPE_LF)) { /* Chked later */
brelse(lbh);
continue;
}
@@ -1794,7 +1794,7 @@ static int check_hash_tbl(struct gfs2_inode *ip, uint64_t *tbl,
proper_len, proper_len);
lbh = bread(ip->i_sbd, leafblk);
gfs2_leaf_in(&leaf, lbh->b_data);
- if (gfs2_check_meta(lbh, GFS2_METATYPE_LF) ||
+ if (gfs2_check_meta(lbh->b_data, GFS2_METATYPE_LF) ||
leaf.lf_depth > ip->i_di.di_depth)
leaf.lf_depth = factor;
brelse(lbh);
@@ -1895,7 +1895,7 @@ static int check_data_qc(struct gfs2_inode *ip, uint64_t metablock,
return -1;
bh = bread(ip->i_sbd, block);
- if (gfs2_check_meta(bh, GFS2_METATYPE_QC) != 0) {
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_QC) != 0) {
log_crit(_("Error: quota_change block at %lld (0x%llx) is "
"the wrong metadata type.\n"),
(unsigned long long)block, (unsigned long long)block);
diff --git a/gfs2/fsck/pass5.c b/gfs2/fsck/pass5.c
index 6234194..d284ab5 100644
--- a/gfs2/fsck/pass5.c
+++ b/gfs2/fsck/pass5.c
@@ -49,7 +49,7 @@ static int check_block_status(struct gfs2_sbd *sdp, struct gfs2_bmap *bl,
struct gfs2_buffer_head *bh;
bh = bread(sdp, block);
- if (gfs2_check_meta(bh, GFS2_METATYPE_DI) == 0)
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_DI) == 0)
count[GFS2_BLKST_DINODE]++;
else
count[GFS1_BLKST_USEDMETA]++;
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index 2f14590..ac44efd 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -70,7 +70,7 @@ static void find_journaled_rgs(struct gfs2_sbd *sdp)
if (!dblock)
break;
bh = bread(sdp, dblock);
- if (!gfs2_check_meta(bh, GFS2_METATYPE_RG)) {
+ if (!gfs2_check_meta(bh->b_data, GFS2_METATYPE_RG)) {
/* False rgrp found at block dblock */
false_count++;
gfs2_special_set(&false_rgrps, dblock);
@@ -127,7 +127,7 @@ static int find_shortest_rgdist(struct gfs2_sbd *sdp, uint64_t *dist_array,
is_rgrp = 0;
else {
bh = bread(sdp, blk);
- is_rgrp = (gfs2_check_meta(bh, GFS2_METATYPE_RG) == 0);
+ is_rgrp = (gfs2_check_meta(bh->b_data, GFS2_METATYPE_RG) == 0);
brelse(bh);
}
if (!is_rgrp) {
@@ -145,7 +145,7 @@ static int find_shortest_rgdist(struct gfs2_sbd *sdp, uint64_t *dist_array,
is_rgrp = 0;
} else {
bh = bread(sdp, nblk);
- is_rgrp = (((gfs2_check_meta(bh,
+ is_rgrp = (((gfs2_check_meta(bh->b_data,
GFS2_METATYPE_RG) == 0)));
brelse(bh);
}
@@ -562,7 +562,7 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, int *num_rgs,
while (blk <= sdp->device.length) {
log_debug( _("Block 0x%llx\n"), (unsigned long long)blk);
bh = bread(sdp, blk);
- rg_was_fnd = (!gfs2_check_meta(bh, GFS2_METATYPE_RG));
+ rg_was_fnd = (!gfs2_check_meta(bh->b_data, GFS2_METATYPE_RG));
brelse(bh);
/* Allocate a new RG and index. */
calc_rgd = rgrp_insert(&sdp->rgcalc, blk);
@@ -594,7 +594,7 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, int *num_rgs,
for (fwd_block = blk + 1; fwd_block < sdp->device.length; fwd_block++) {
int bitmap_was_fnd;
bh = bread(sdp, fwd_block);
- bitmap_was_fnd = !gfs2_check_meta(bh, GFS2_METATYPE_RB);
+ bitmap_was_fnd = !gfs2_check_meta(bh->b_data, GFS2_METATYPE_RB);
brelse(bh);
if (bitmap_was_fnd) /* if a bitmap */
calc_rgd->ri.ri_length++;
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 7e87e43..0acd59b 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -887,7 +887,7 @@ void dirent2_del(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
uint16_t cur_rec_len, prev_rec_len;
bmodified(bh);
- if (gfs2_check_meta(bh, GFS2_METATYPE_LF) == 0) {
+ if (gfs2_check_meta(bh->b_data, GFS2_METATYPE_LF) == 0) {
struct gfs2_leaf *lf = (struct gfs2_leaf *)bh->b_data;
lf->lf_entries = be16_to_cpu(lf->lf_entries) - 1;
@@ -1107,7 +1107,7 @@ int gfs2_get_leaf(struct gfs2_inode *dip, uint64_t leaf_no,
int error = 0;
*bhp = bread(dip->i_sbd, leaf_no);
- error = gfs2_check_meta(*bhp, GFS2_METATYPE_LF);
+ error = gfs2_check_meta((*bhp)->b_data, GFS2_METATYPE_LF);
if(error)
brelse(*bhp);
return error;
@@ -1159,7 +1159,7 @@ static int get_next_leaf(struct gfs2_inode *dip,struct gfs2_buffer_head *bh_in,
if (*bh_out == NULL)
return -ENOENT;
/* Check for a leaf pointing to a non-leaf */
- if (gfs2_check_meta(*bh_out, GFS2_METATYPE_LF)) {
+ if (gfs2_check_meta((*bh_out)->b_data, GFS2_METATYPE_LF)) {
brelse(*bh_out);
*bh_out = NULL;
return -ENOENT;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index f75ff1e..fc0afed 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -699,7 +699,7 @@ extern int build_quota(struct gfs2_sbd *sdp);
extern int build_root(struct gfs2_sbd *sdp);
extern int do_init_inum(struct gfs2_sbd *sdp);
extern int do_init_statfs(struct gfs2_sbd *sdp);
-extern int gfs2_check_meta(struct gfs2_buffer_head *bh, int type);
+extern int gfs2_check_meta(const char *buf, int type);
extern unsigned lgfs2_bm_scan(struct rgrp_tree *rgd, unsigned idx,
uint64_t *buf, uint8_t state);
extern int build_inum_range(struct gfs2_inode *per_node, unsigned int j);
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index 20ce580..bd69301 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -221,7 +221,7 @@ uint64_t gfs2_rgrp_read(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
int mtype = (x ? GFS2_METATYPE_RB : GFS2_METATYPE_RG);
bi->bi_bh = bhs[x];
- if (gfs2_check_meta(bi->bi_bh, mtype)) {
+ if (gfs2_check_meta(bi->bi_bh->b_data, mtype)) {
unsigned err = x;
do {
brelse(rgd->bits[x].bi_bh);
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index c84701d..b00c2a9 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -648,10 +648,10 @@ int do_init_statfs(struct gfs2_sbd *sdp)
return 0;
}
-int gfs2_check_meta(struct gfs2_buffer_head *bh, int type)
+int gfs2_check_meta(const char *buf, int type)
{
- uint32_t check_magic = ((struct gfs2_meta_header *)(bh->b_data))->mh_magic;
- uint32_t check_type = ((struct gfs2_meta_header *)(bh->b_data))->mh_type;
+ uint32_t check_magic = ((struct gfs2_meta_header *)buf)->mh_magic;
+ uint32_t check_type = ((struct gfs2_meta_header *)buf)->mh_type;
check_magic = be32_to_cpu(check_magic);
check_type = be32_to_cpu(check_type);
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index 7592564..6fe29ad 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -181,7 +181,7 @@ static int good_on_disk(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
int is_rgrp;
bh = bread(sdp, rgd->ri.ri_addr);
- is_rgrp = (gfs2_check_meta(bh, GFS2_METATYPE_RG) == 0);
+ is_rgrp = (gfs2_check_meta(bh->b_data, GFS2_METATYPE_RG) == 0);
brelse(bh);
return is_rgrp;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[gfs2-utils] 03/03: libgfs2: Speed up bread()
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 7f8ece48708594e4aecceb096942e4db7562a1c7
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Jun 5 16:39:02 2019 +0100
libgfs2: Speed up bread()
While bread() is still used in many hard-to-refactor places it should be
as performant as possible. Implementing it in terms of breadm() adds
extra iovec allocation overhead so simplify it by implementing it with a
simpler bget() and pread().
This only shows a 0.5% speed up in testing but that scales up to an hour
off a 300TB fsck.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/buf.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/gfs2/libgfs2/buf.c b/gfs2/libgfs2/buf.c
index 92cd393..097ac33 100644
--- a/gfs2/libgfs2/buf.c
+++ b/gfs2/libgfs2/buf.c
@@ -77,12 +77,20 @@ struct gfs2_buffer_head *__bread(struct gfs2_sbd *sdp, uint64_t num, int line,
const char *caller)
{
struct gfs2_buffer_head *bh;
- int ret;
+ ssize_t ret;
- ret = __breadm(sdp, &bh, 1, num, line, caller);
- if (ret >= 0)
- return bh;
- return NULL;
+ bh = bget(sdp, num);
+ if (bh == NULL)
+ return NULL;
+
+ ret = pread(sdp->device_fd, bh->b_data, sdp->bsize, num * sdp->bsize);
+ if (ret != sdp->bsize) {
+ fprintf(stderr, "%s:%d: Error reading block %"PRIu64": %s\n",
+ caller, line, num, strerror(errno));
+ free(bh);
+ bh = NULL;
+ }
+ return bh;
}
int bwrite(struct gfs2_buffer_head *bh)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[gfs2-utils] 02/03: fsck.gfs2: Disambiguate 'check_data'
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 3b7faac2359cad37a7fd533547f0ec51ceb4d22f
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Jun 4 17:16:18 2019 +0100
fsck.gfs2: Disambiguate 'check_data'
Having several functions with this name confuses profiling tools and
makes reports difficult to read. Give the different check_data
functions better names.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/metawalk.c | 4 ++--
gfs2/fsck/pass1.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 03dd2d6..118e6f3 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -1393,7 +1393,7 @@ error_undo: /* undo what we've done so far for this block */
* 1 if errors were found and corrected
* 2 (ENOENT) is there were too many bad pointers
*/
-static int check_data(struct gfs2_inode *ip, struct metawalk_fxns *pass,
+static int metawalk_check_data(struct gfs2_inode *ip, struct metawalk_fxns *pass,
struct gfs2_buffer_head *bh, int head_size,
uint64_t *blks_checked, struct error_block *error_blk)
{
@@ -1591,7 +1591,7 @@ int check_metatree(struct gfs2_inode *ip, struct metawalk_fxns *pass)
continue;
if (pass->check_data)
- error = check_data(ip, pass, bh, head_size,
+ error = metawalk_check_data(ip, pass, bh, head_size,
&blks_checked, &error_blk);
if (pass->big_file_msg && ip->i_di.di_blocks > COMFORTABLE_BLKS)
pass->big_file_msg(ip, blks_checked);
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index faff884..24a6498 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -44,7 +44,7 @@ static int check_metalist(struct gfs2_inode *ip, uint64_t block,
int *was_duplicate, void *private);
static int undo_check_metalist(struct gfs2_inode *ip, uint64_t block,
int h, void *private);
-static int check_data(struct gfs2_inode *ip, uint64_t metablock,
+static int pass1_check_data(struct gfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bh, uint64_t *ptr);
static int undo_check_data(struct gfs2_inode *ip, uint64_t block,
@@ -192,7 +192,7 @@ struct metawalk_fxns pass1_fxns = {
.private = NULL,
.check_leaf = p1check_leaf,
.check_metalist = check_metalist,
- .check_data = check_data,
+ .check_data = pass1_check_data,
.check_eattr_indir = check_eattr_indir,
.check_eattr_leaf = check_eattr_leaf,
.check_dentry = NULL,
@@ -542,7 +542,7 @@ out:
return error;
}
-static int check_data(struct gfs2_inode *ip, uint64_t metablock,
+static int pass1_check_data(struct gfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bbh, uint64_t *ptr)
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months
[gfs2-utils] 01/03: fsck.gfs2: Remove some unnecessary and slow
gettext calls
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 99aac792fbe7ef6fcbebc2208268836367bb34d2
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Jun 4 15:03:11 2019 +0100
fsck.gfs2: Remove some unnecessary and slow gettext calls
Many of the gettext calls are in functions which are called often enough
that there is a significant performance hit. Others are unnecessary or
in debug logging where i18n is unimportant.
This gives well over a 5% speed up in my tests on a full 300TB fs.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/metawalk.c | 5 ++---
gfs2/fsck/pass1.c | 29 ++++++++++++++---------------
gfs2/fsck/pass1b.c | 14 +++++++-------
3 files changed, 23 insertions(+), 25 deletions(-)
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index a7780d7..03dd2d6 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -1404,8 +1404,7 @@ static int check_data(struct gfs2_inode *ip, struct metawalk_fxns *pass,
uint64_t metablock = bh->b_blocknr;
/* If there isn't much pointer corruption check the pointers */
- log_debug(_("\nProcessing data blocks for inode 0x%llx, metadata "
- "block 0x%llx.\n"),
+ log_debug("Processing data blocks for inode 0x%llx, metadata block 0x%llx.\n",
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)bh->b_blocknr);
for (ptr = ptr_start ; (char *)ptr < ptr_end && !fsck_abort; ptr++) {
@@ -1673,7 +1672,7 @@ undo_metalist:
to undo. */
delete_all_dups(ip);
/* Set the dinode as "bad" so it gets deleted */
- fsck_bitmap_set(ip, ip->i_di.di_num.no_addr, _("corrupt"),
+ fsck_bitmap_set(ip, ip->i_di.di_num.no_addr, "corrupt",
GFS2_BLKST_FREE);
log_err(_("The corrupt inode was invalidated.\n"));
out:
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 3c2f74f..faff884 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -511,7 +511,7 @@ static int blockmap_set_as_data(struct gfs2_inode *ip, uint64_t block)
struct gfs2_buffer_head *bh;
struct gfs2_dinode *di;
- error = fsck_blkmap_set_noino(ip, block, _("data"), GFS2_BLKST_USED);
+ error = fsck_blkmap_set_noino(ip, block, "data", GFS2_BLKST_USED);
if (!error)
return 0;
@@ -537,7 +537,7 @@ static int blockmap_set_as_data(struct gfs2_inode *ip, uint64_t block)
error = -1;
out:
if (!error)
- fsck_blockmap_set(ip, block, _("data"), GFS2_BLKST_USED);
+ fsck_blockmap_set(ip, block, "data", GFS2_BLKST_USED);
brelse(bh);
return error;
}
@@ -642,13 +642,13 @@ static int check_data(struct gfs2_inode *ip, uint64_t metablock,
log_info(_("Block %lld (0x%llx) is a GFS1 rindex block\n"),
(unsigned long long)block, (unsigned long long)block);
gfs2_special_set(&gfs1_rindex_blks, block);
- fsck_blockmap_set(ip, block, _("rgrp"), GFS2_BLKST_DINODE);
+ fsck_blockmap_set(ip, block, "rgrp", GFS2_BLKST_DINODE);
/*gfs2_meta_rgrp);*/
} else if (ip->i_sbd->gfs1 && ip->i_di.di_flags & GFS2_DIF_JDATA) {
log_info(_("Block %lld (0x%llx) is a GFS1 journaled data "
"block\n"),
(unsigned long long)block, (unsigned long long)block);
- fsck_blockmap_set(ip, block, _("jdata"), GFS2_BLKST_DINODE);
+ fsck_blockmap_set(ip, block, "jdata", GFS2_BLKST_DINODE);
} else
return blockmap_set_as_data(ip, block);
return 0;
@@ -1286,25 +1286,25 @@ static int set_ip_blockmap(struct gfs2_inode *ip)
switch (mode) {
case S_IFDIR:
- ty = _("directory");
+ ty = "directory";
break;
case S_IFREG:
- ty = _("file");
+ ty = "file";
break;
case S_IFLNK:
- ty = _("symlink");
+ ty = "symlink";
break;
case S_IFBLK:
- ty = _("block device");
+ ty = "block device";
break;
case S_IFCHR:
- ty = _("character device");
+ ty = "character device";
break;
case S_IFIFO:
- ty = _("fifo");
+ ty = "fifo";
break;
case S_IFSOCK:
- ty = _("socket");
+ ty = "socket";
break;
default:
return -EINVAL;
@@ -1372,7 +1372,7 @@ static int alloc_leaf(struct gfs2_inode *ip, uint64_t block, void *private)
after the bitmap has been set but before the blockmap has. */
q = bitmap_type(ip->i_sbd, block);
if (q == GFS2_BLKST_FREE)
- fsck_blockmap_set(ip, block, _("newly allocated leaf"),
+ fsck_blockmap_set(ip, block, "newly allocated leaf",
ip->i_sbd->gfs1 ? GFS2_BLKST_DINODE :
GFS2_BLKST_USED);
return 0;
@@ -2193,12 +2193,11 @@ int pass1(struct gfs2_sbd *sdp)
goto out;
}
next = osi_next(n);
- log_debug( _("Checking metadata in Resource Group #%llu\n"),
+ log_debug("Checking metadata in resource group #%llu\n",
(unsigned long long)rg_count);
rgd = (struct rgrp_tree *)n;
for (i = 0; i < rgd->ri.ri_length; i++) {
- log_debug( _("rgrp block %lld (0x%llx) "
- "is now marked as 'rgrp data'\n"),
+ log_debug("rgrp block %lld (0x%llx) is now marked as 'rgrp data'\n",
rgd->ri.ri_addr + i, rgd->ri.ri_addr + i);
if (gfs2_blockmap_set(bl, rgd->ri.ri_addr + i,
GFS2_BLKST_USED)) {
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 62686fe..574622b 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -521,25 +521,25 @@ static int set_ip_bitmap(struct gfs2_inode *ip)
switch (mode) {
case S_IFDIR:
- ty = _("directory");
+ ty = "directory";
break;
case S_IFREG:
- ty = _("file");
+ ty = "file";
break;
case S_IFLNK:
- ty = _("symlink");
+ ty = "symlink";
break;
case S_IFBLK:
- ty = _("block device");
+ ty = "block device";
break;
case S_IFCHR:
- ty = _("character device");
+ ty = "character device";
break;
case S_IFIFO:
- ty = _("fifo");
+ ty = "fifo";
break;
case S_IFSOCK:
- ty = _("socket");
+ ty = "socket";
break;
default:
return -EINVAL;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
4 years, 10 months