[gfs2-utils] 02/10: gfs2_convert: Remove fd parameter from
gfs1_ri_update
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 4e718620ea5a98386349cd7a9a8e9f3deaf1510e
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Mar 22 11:37:46 2021 +0000
gfs2_convert: Remove fd parameter from gfs1_ri_update
It's only called with fd == 0 so use that instead.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 839e29ba..e43c9aa4 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1550,7 +1550,7 @@ static int sanity_check(struct gfs2_sbd *sdp)
*
* Returns: 0 on success, -1 on failure.
*/
-static int gfs1_ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int quiet)
+static int gfs1_ri_update(struct gfs2_sbd *sdp, int *rgcount, int quiet)
{
struct rgrp_tree *rgd;
struct gfs2_rindex *ri;
@@ -1560,7 +1560,7 @@ static int gfs1_ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int quiet)
struct osi_node *n, *next = NULL;
int ok;
- if (rindex_read(sdp, fd, &count1, &ok))
+ if (rindex_read(sdp, 0, &count1, &ok))
goto fail;
for (n = osi_first(&sdp->rgtree); n; n = next) {
next = osi_next(n);
@@ -1715,7 +1715,7 @@ static int init(struct gfs2_sbd *sbp, struct gfs2_options *opts)
sbp->md.riinode->i_di.di_mode &= ~S_IFMT;
sbp->md.riinode->i_di.di_mode |= S_IFDIR;
printf(_("Examining file system"));
- if (gfs1_ri_update(sbp, 0, &rgcount, 0)){
+ if (gfs1_ri_update(sbp, &rgcount, 0)){
log_crit(_("Unable to fill in resource group information.\n"));
return -1;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] 01/10: libgfs2: Move gfs1_ri_update() into gfs2_convert
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 a2ffc35b5e4e7ba01be47b4566ef0b43bc06db6c
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Mar 22 11:26:15 2021 +0000
libgfs2: Move gfs1_ri_update() into gfs2_convert
gfs2_convert is the only user of this function. This duplicates a
simplified version of ri_update into gfs2_convert which means we can
safely make changes to ri_update for gfs2 filesystems.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 49 +++++++++++++++++++++++++++++++++++++++++++++
gfs2/libgfs2/libgfs2.h | 1 -
gfs2/libgfs2/super.c | 17 ----------------
3 files changed, 49 insertions(+), 18 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index dd945032..839e29ba 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1542,6 +1542,55 @@ static int sanity_check(struct gfs2_sbd *sdp)
return error;
}
+/**
+ * gfs1_ri_update - attach rgrps to the super block
+ *
+ * Given the rgrp index inode, link in all rgrps into the super block
+ * and be sure that they can be read.
+ *
+ * Returns: 0 on success, -1 on failure.
+ */
+static int gfs1_ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int quiet)
+{
+ struct rgrp_tree *rgd;
+ struct gfs2_rindex *ri;
+ uint64_t count1 = 0, count2 = 0;
+ uint64_t errblock = 0;
+ uint64_t rmax = 0;
+ struct osi_node *n, *next = NULL;
+ int ok;
+
+ if (rindex_read(sdp, fd, &count1, &ok))
+ goto fail;
+ for (n = osi_first(&sdp->rgtree); n; n = next) {
+ next = osi_next(n);
+ rgd = (struct rgrp_tree *)n;
+ /* Read resource group header */
+ errblock = gfs2_rgrp_read(sdp, rgd);
+ if (errblock)
+ return errblock;
+ count2++;
+ if (!quiet && count2 % 100 == 0) {
+ printf(".");
+ fflush(stdout);
+ }
+ ri = &rgd->ri;
+ if (ri->ri_data0 + ri->ri_data - 1 > rmax)
+ rmax = ri->ri_data0 + ri->ri_data - 1;
+ }
+
+ sdp->fssize = rmax;
+ *rgcount = count1;
+ if (count1 != count2)
+ goto fail;
+
+ return 0;
+
+ fail:
+ gfs2_rgrp_free(sdp, &sdp->rgtree);
+ return -1;
+}
+
/* ------------------------------------------------------------------------- */
/* init - initialization code */
/* Returns: 0 on success, -1 on failure */
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 1f64b59e..12275098 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -634,7 +634,6 @@ extern void gfs1_block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
uint64_t *dblock, uint32_t *extlen, int prealloc);
extern int gfs1_writei(struct gfs2_inode *ip, char *buf, uint64_t offset,
unsigned int size);
-extern int gfs1_ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int quiet);
extern struct gfs2_inode *lgfs2_gfs_inode_get(struct gfs2_sbd *sdp, char *buf);
extern struct gfs2_inode *lgfs2_gfs_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr);
extern void gfs_jindex_in(struct gfs_jindex *jindex, char *buf);
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index 2fc83fea..039b7428 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -354,20 +354,3 @@ int ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *sane)
{
return __ri_update(sdp, fd, rgcount, sane, 1);
}
-
-/**
- * gfs1_ri_update - attach rgrps to the super block
- * Stolen from libgfs2/super.c, but modified to handle gfs1.
- * @sdp:
- *
- * Given the rgrp index inode, link in all rgrps into the super block
- * and be sure that they can be read.
- *
- * Returns: 0 on success, -1 on failure.
- */
-int gfs1_ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int quiet)
-{
- int sane;
-
- return __ri_update(sdp, fd, rgcount, &sane, quiet);
-}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] branch master updated (657bbcfb -> ae74ab51)
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a change to branch master
in repository gfs2-utils.
from 657bbcfb gfs2_jadd: Don't fsync after each block written
new a2ffc35b libgfs2: Move gfs1_ri_update() into gfs2_convert
new 4e718620 gfs2_convert: Remove fd parameter from gfs1_ri_update
new ce962c54 libgfs2: Fold __ri_update into ri_update
new acfbd791 libgfs2: Move ri_update() into fsck.gfs2
new 61f98981 libgfs2: Clean up rindex_read()
new 5a8b7d3e Update some variable names for consistency
new 3f1b63ed libgfs2: Implement meta.c checks as unit tests
new 16361c6a libgfs2: Move build_rgrps into fsck.gfs2
new e2fcfc33 libgfs2: Remove fs_geometry.c
new ae74ab51 libgfs2: Replace lgfs2_rgrps_root() with lgfs2_attach_rgrps()
The 10 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
gfs2/convert/gfs2_convert.c | 51 ++++++++++++++-
gfs2/edit/hexedit.c | 4 +-
gfs2/fsck/fsck.h | 3 +-
gfs2/fsck/initialize.c | 85 +++++++++++++++++++++++-
gfs2/fsck/rgrepair.c | 43 ++++++++++--
gfs2/libgfs2/Makefile.am | 1 -
gfs2/libgfs2/check_meta.c | 57 ++++++++++++++--
gfs2/libgfs2/checks.am | 1 -
gfs2/libgfs2/fs_geometry.c | 87 -------------------------
gfs2/libgfs2/gfs2l.c | 4 +-
gfs2/libgfs2/libgfs2.h | 9 +--
gfs2/libgfs2/meta.c | 83 ------------------------
gfs2/libgfs2/rgrp.c | 30 ++++++++-
gfs2/libgfs2/super.c | 155 ++++++--------------------------------------
gfs2/mkfs/main_mkfs.c | 2 +-
15 files changed, 281 insertions(+), 334 deletions(-)
delete mode 100644 gfs2/libgfs2/fs_geometry.c
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] 02/02: gfs2_jadd: Don't fsync after each block written
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 657bbcfb7114b0246c6ce72cde75fcacb9a0d61b
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Thu Mar 18 17:50:16 2021 +0000
gfs2_jadd: Don't fsync after each block written
gfs2_jadd has always called fsync() after writing each block of the
journal. There doesn't seem to be any need for that so take the fsync()
call out of the loop.
Add an additional fsync() after preallocation to make sure we're in good
shape before writing the log headers.
In my tests this reduces the time to add one journal from 5 minutes to
9 seconds.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/mkfs/main_jadd.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
index 0a18bfb2..2bd0f7b0 100644
--- a/gfs2/mkfs/main_jadd.c
+++ b/gfs2/mkfs/main_jadd.c
@@ -537,6 +537,11 @@ static int add_j(struct gfs2_sbd *sdp, struct jadd_opts *opts)
if (error != 0)
goto close_fd;
+ error = fsync(fd);
+ if (error != 0) {
+ perror("Failed to sync journal metadata");
+ goto close_fd;
+ }
if ((error = lseek(fd, 0, SEEK_SET)) < 0) {
perror("add_j lseek");
goto close_fd;
@@ -580,12 +585,12 @@ static int add_j(struct gfs2_sbd *sdp, struct jadd_opts *opts)
seq = 0;
off += sdp->bsize;
- if ((error = fsync(fd))) {
- perror("add_j fsync");
- goto close_fd;
- }
}
-
+ error = fsync(fd);
+ if (error != 0) {
+ perror("Failed to sync journal metadata");
+ goto close_fd;
+ }
sprintf(new_name, "journal%u", opts->journals);
error = rename2system(opts, opts->jindex, new_name);
if (error < 0 && errno != EEXIST){
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] 01/02: gfs2_jadd: Use fallocate to preallocate journals
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 2010383c860ef8ca2a80e6394b9cb89942a426e0
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Thu Mar 18 17:30:53 2021 +0000
gfs2_jadd: Use fallocate to preallocate journals
Fall back to writes for ancient kernels and use larger writes in that
case to reduce the chance of fragmentation.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/mkfs/main_jadd.c | 48 ++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 40 insertions(+), 8 deletions(-)
diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
index 7583ba0f..0a18bfb2 100644
--- a/gfs2/mkfs/main_jadd.c
+++ b/gfs2/mkfs/main_jadd.c
@@ -480,6 +480,43 @@ static uint64_t find_block_address(int fd, off_t offset, unsigned bsize)
}
#endif
+static int alloc_new_journal(int fd, unsigned bytes)
+{
+#define ALLOC_BUF_SIZE (4 << 20)
+ unsigned left = bytes;
+ int error;
+ char *buf;
+
+ error = fallocate(fd, 0, 0, bytes);
+ if (error == 0)
+ return 0;
+ if (errno != EOPNOTSUPP)
+ goto out_errno;
+
+ /* No fallocate support, fall back to writes */
+ buf = calloc(1, ALLOC_BUF_SIZE);
+ if (buf == NULL)
+ goto out_errno;
+
+ while (left > 0) {
+ unsigned sz = ALLOC_BUF_SIZE;
+
+ if (left < ALLOC_BUF_SIZE)
+ sz = left;
+
+ if (pwrite(fd, buf, sz, bytes - left) != sz) {
+ free(buf);
+ goto out_errno;
+ }
+ left -= sz;
+ }
+ free(buf);
+ return 0;
+out_errno:
+ perror("Failed to allocate space for new journal");
+ return -1;
+}
+
static int add_j(struct gfs2_sbd *sdp, struct jadd_opts *opts)
{
int fd, error = 0;
@@ -496,14 +533,9 @@ static int add_j(struct gfs2_sbd *sdp, struct jadd_opts *opts)
if ((error = set_flags(fd, JA_FL_CLEAR, FS_JOURNAL_DATA_FL)))
goto close_fd;
- memset(buf, 0, sdp->bsize);
- for (x=0; x<blocks; x++) {
- if (write(fd, buf, sdp->bsize) != sdp->bsize) {
- perror("add_j write");
- error = -1;
- goto close_fd;
- }
- }
+ error = alloc_new_journal(fd, sdp->jsize << 20);
+ if (error != 0)
+ goto close_fd;
if ((error = lseek(fd, 0, SEEK_SET)) < 0) {
perror("add_j lseek");
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] branch master updated (34711dd0 -> 657bbcfb)
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a change to branch master
in repository gfs2-utils.
from 34711dd0 Update version string for dev
new 2010383c gfs2_jadd: Use fallocate to preallocate journals
new 657bbcfb gfs2_jadd: Don't fsync after each block written
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
gfs2/mkfs/main_jadd.c | 63 ++++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 50 insertions(+), 13 deletions(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] branch master updated: Update version string for dev
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.
The following commit(s) were added to refs/heads/master by this push:
new 34711dd0 Update version string for dev
34711dd0 is described below
commit 34711dd00cd9f808fd162ea53e3338b52960b3c0
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Mar 15 15:32:38 2021 +0000
Update version string for dev
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index f8dac75e..5c2d45cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
-AC_INIT([gfs2-utils], [3.4.1], [cluster-devel(a)redhat.com])
+AC_INIT([gfs2-utils], [3.4.1.1.dev], [cluster-devel(a)redhat.com])
AM_INIT_AUTOMAKE([-Wno-portability])
AM_SILENT_RULES([yes])
LT_PREREQ([2.2.6])
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] annotated tag 3.4.1 created (now 0ddaa470)
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a change to annotated tag 3.4.1
in repository gfs2-utils.
at 0ddaa470 (tag)
tagging ef93e7aded3a41af3a6f3ee60415a4773c5a054d (commit)
replaces 3.4.0
by Andrew Price
on Mon Mar 15 09:59:55 2021 +0000
- Log -----------------------------------------------------------------
Version 3.4.1
-----------------------------------------------------------------------
This annotated tag includes the following new commits:
new 1886142f libgfs2: Fix a format version check in check_sb()
new ef93e7ad Prepare for version 3.4.1
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] 02/02: Prepare for version 3.4.1
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 ef93e7aded3a41af3a6f3ee60415a4773c5a054d
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Mar 15 09:59:09 2021 +0000
Prepare for version 3.4.1
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
configure.ac | 2 +-
po/gfs2-utils.pot | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index 1bca9766..f8dac75e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
-AC_INIT([gfs2-utils], [3.4.0.1.dev], [cluster-devel(a)redhat.com])
+AC_INIT([gfs2-utils], [3.4.1], [cluster-devel(a)redhat.com])
AM_INIT_AUTOMAKE([-Wno-portability])
AM_SILENT_RULES([yes])
LT_PREREQ([2.2.6])
diff --git a/po/gfs2-utils.pot b/po/gfs2-utils.pot
index 47819e55..42743f51 100644
--- a/po/gfs2-utils.pot
+++ b/po/gfs2-utils.pot
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: gfs2-utils 3.4.0\n"
+"Project-Id-Version: gfs2-utils 3.4.0.1.dev\n"
"Report-Msgid-Bugs-To: cluster-devel(a)redhat.com\n"
-"POT-Creation-Date: 2021-03-08 14:34+0000\n"
+"POT-Creation-Date: 2021-03-15 09:57+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] 01/02: libgfs2: Fix a format version check in check_sb()
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 1886142f9267edec75c903a899f1431f61b54281
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Mar 15 09:55:21 2021 +0000
libgfs2: Fix a format version check in check_sb()
Make sure the minimum format version we check against is the minimum
possible and not the current format version.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index f38c3d72..2fc83fea 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -36,7 +36,7 @@ int check_sb(struct gfs2_sb *sb)
return 1;
}
/* It's gfs2. Check format number is in a sensible range. */
- if (sb->sb_fs_format < GFS2_FORMAT_FS ||
+ if (sb->sb_fs_format < LGFS2_FS_FORMAT_MIN ||
sb->sb_fs_format > 1899) {
errno = EINVAL;
return -1;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month