Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=69b90626f1…
Commit: 69b90626f1a1d800cfc1c5ba63ea1b4426d71fba
Parent: db0b71296df802ff8c9bd8fdb64119f58414ec6d
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Wed May 25 12:49:23 2016 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Wed May 25 12:49:23 2016 -0500
gfs2_edit: Make 'j' jump to journaled block on log descriptors
The jump command ordinarily jumps to the absolute block in the file
system. That makes sense for almost all cases. For log descriptors,
you're usually more interested in the journaled blocks than the
actual blocks. So this patch makes 'j' jump to the journaled version
of the block rather than the absolute block, when you're looking
at a log descriptor block.
Signed-off-by: Bob Peterson <rpeterso(a)redhat.com>
---
gfs2/edit/hexedit.c | 45 ++++++++++++++++++++++++++++++++++++---------
1 files changed, 36 insertions(+), 9 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 2ce111d..40a719e 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -545,6 +545,17 @@ static const struct lgfs2_metadata *find_mtype(uint32_t mtype, const unsigned ve
return NULL;
}
+static int get_pnum(int ptroffset)
+{
+ int pnum;
+
+ pnum = pgnum * screen_chunk_size;
+ pnum += (ptroffset - struct_len);
+ pnum /= sizeof(uint64_t);
+
+ return pnum;
+}
+
/* ------------------------------------------------------------------------ */
/* hexdump - hex dump the filesystem block to the screen */
/* ------------------------------------------------------------------------ */
@@ -559,6 +570,7 @@ static int hexdump(uint64_t startaddr, int len, int trunc_zeros,
int print_field, cursor_line;
const uint32_t block_type = get_block_type(bh, NULL);
uint64_t *ref;
+ int ptroffset = 0;
strcpy(edit_fmt,"%02x");
pointer = (unsigned char *)lpBuffer + offset;
@@ -679,19 +691,17 @@ static int hexdump(uint64_t startaddr, int len, int trunc_zeros,
}
if (cursor_line) {
if (block_type == GFS2_METATYPE_IN ||
+ block_type == GFS2_METATYPE_LD ||
((block_type == GFS2_METATYPE_DI) &&
((struct gfs2_dinode*)bh->b_data)->di_height) ||
S_ISDIR(di.di_mode)) {
- int ptroffset = edit_row[dmode] * 16 +
+ ptroffset = edit_row[dmode] * 16 +
edit_col[dmode];
if (ptroffset >= struct_len || pgnum) {
- int pnum;
-
- pnum = pgnum * screen_chunk_size;
- pnum += (ptroffset - struct_len);
- pnum /= sizeof(uint64_t);
-
+ int pnum = get_pnum(ptroffset);
+ if (block_type == GFS2_METATYPE_LD)
+ print_gfs2("*");
print_gfs2("pointer 0x%x", pnum);
}
}
@@ -713,6 +723,13 @@ static int hexdump(uint64_t startaddr, int len, int trunc_zeros,
if ((const char *)pointer >= zeros_strt)
break;
} /* while */
+ if (block_type == GFS2_METATYPE_LD && ptroffset >= struct_len) {
+ COLORS_NORMAL;
+ eol(0);
+ print_gfs2(" * 'j' will jump to the journaled block, "
+ "not the absolute block.");
+ eol(0);
+ }
if (sbd.gfs1) {
COLORS_NORMAL;
print_gfs2(" *** This seems to be a GFS-1 file system ***");
@@ -1610,18 +1627,28 @@ static void pagedn(void)
/* ------------------------------------------------------------------------ */
/* jump - jump to the address the cursor is on */
+/* */
+/* If the cursor is in a log descriptor, jump to the log-descriptor version */
+/* of the block instead of the "real" block. */
/* ------------------------------------------------------------------------ */
static void jump(void)
{
if (dmode == HEX_MODE) {
unsigned int col2;
uint64_t *b;
+ const uint32_t block_type = get_block_type(bh, NULL);
- if (edit_row[dmode] >= 0) {
+ /* special exception for log descriptors: jump the journaled
+ version of the block, not the "real" block */
+ if (block_type == GFS2_METATYPE_LD) {
+ int ptroffset = edit_row[dmode] * 16 + edit_col[dmode];
+ int pnum = get_pnum(ptroffset);
+ temp_blk = bh->b_blocknr + pnum + 1;
+ } else if (edit_row[dmode] >= 0) {
col2 = edit_col[dmode] & 0x08;/* thus 0-7->0, 8-15->8 */
b = (uint64_t *)&bh->b_data[edit_row[dmode]*16 +
offset + col2];
- temp_blk=be64_to_cpu(*b);
+ temp_blk = be64_to_cpu(*b);
}
}
else
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=e8b3b74b70…
Commit: e8b3b74b7084bb8ebfff207c144ac310109cfc92
Parent: c738322c0fa4669aef27d6ed501953e24a26a6b1
Author: Benjamin Marzinski <bmarzins(a)redhat.com>
AuthorDate: Fri Apr 15 11:33:43 2016 -0500
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Tue May 17 17:05:22 2016 +0100
gfs2(5): add rgrplbv and loccookie info the the manpage
The gfs2 man page didn't have any information about the rgrplvb and
loccookie mount options. This patch adds it.
Signed-off-by: Benjamin Marzinski <bmarzins(a)redhat.com>
---
gfs2/man/gfs2.5 | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/gfs2/man/gfs2.5 b/gfs2/man/gfs2.5
index 0517944..56d1a00 100644
--- a/gfs2/man/gfs2.5
+++ b/gfs2/man/gfs2.5
@@ -165,6 +165,40 @@ the statfs information on a local basis before it is synced back
to the master statfs file, even if the time period has not
expired. If the setting of statfs_quantum is 0, then this setting
is ignored.
+.TP
+\fBrgrplvb\fP
+This flag tells gfs2 to look for information about a resource group's free
+space and unlinked inodes in its glock lock value block. This keeps gfs2 from
+having to read in the resource group data from disk, speeding up allocations in
+some cases. This option was added in the 3.6 Linux kernel. Prior to this
+kernel, no information was saved to the resource group lvb. \fBNote:\fP To
+safely turn on this option, all nodes mounting the filesystem must be running
+at least a 3.6 Linux kernel. If any nodes had previously mounted the filesystem
+using older kernels, the filesystem must be unmounted on all nodes before it
+can be mounted with this option enabled. This option does not need to be
+enabled on all nodes using a filesystem.
+.TP
+\fBloccookie\fP
+This flag tells gfs2 to use location based readdir cookies, instead of its
+usual filename hash readdir cookies. The filename hash cookies are not
+guaranteed to be unique, and as the number of files in a directory increases,
+so does the likelihood of a collision. NFS requires readdir cookies to be
+unique, which can cause problems with very large directories (over 100,000
+files). With this flag set, gfs2 will try to give out location based cookies.
+Since the cookie is 31 bits, gfs2 will eventually run out of unique cookies,
+and will fail back to using hash cookies. The maximum number of files that
+could have unique location cookies assuming perfectly even hashing and names of
+8 or fewer characters is 1,073,741,824. An average directory should be able to
+give out well over half a billion location based cookies. This option was added
+in the 4.5 Linux kernel. Prior to this kernel, gfs2 did not add directory
+entries in a way that allowed it to use location based readdir cookies.
+\fBNote:\fP To safely turn on this option, all nodes mounting the filesystem
+must be running at least a 4.5 Linux kernel. If this option is only enabled on
+some of the nodes mounting a filesystem, the cookies returned by nodes using
+this option will not be valid on nodes that are not using this option, and vice
+versa. Finally, when first enabling this option on a filesystem that had been
+previously mounted without it, you must make sure that there are no outstanding
+cookies being cached by other software, such as NFS.
.SH BUGS
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=c738322c0f…
Commit: c738322c0fa4669aef27d6ed501953e24a26a6b1
Parent: 606ea6625fbbe7839394707ebace1391e0e42d4f
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue May 10 15:24:04 2016 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Tue May 10 15:24:04 2016 +0100
gfs2_edit savemeta: Fix use of uninitialized 'blk'
Fixes
"savemeta.c:737:14: warning: ���blk��� may be used uninitialized in this function"
blk is never actually used uninitialized here but the compiler can't
reason it out, so make it explicit to silence the warning.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/savemeta.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 8510d77..db9a947 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -712,7 +712,7 @@ static void get_journal_inode_blocks(void)
static void save_allocated(struct rgrp_tree *rgd, struct metafd *mfd)
{
int blktype;
- uint64_t blk;
+ uint64_t blk = 0;
unsigned i, j, m;
uint64_t *ibuf = malloc(sbd.bsize * GFS2_NBBY * sizeof(uint64_t));