Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=2ad0448631…
Commit: 2ad0448631bdc37a82d6e7db4e48ea48b892716c
Parent: cbb17b94ce6aa3813f0544acd8e1f3c6f8d4f038
Author: Paul Evans <pevans(a)redhat.com>
AuthorDate: Thu Oct 15 16:40:25 2015 +0100
Committer: Paul Evans <pevans(a)redhat.com>
CommitterDate: Mon Oct 19 14:07:49 2015 +0100
mkfs.gfs2: print message about BKLDISCARD ioctl taking a long time
When running mkfs.gfs2 the BLKDISCARD ioctl() can sit waiting for a
long time without feedback.
Added a message in mkfs.gfs2 to the user just before the ioctl begins
to warn the user that the operation could take a while to complete.
Signed-off-by: Paul Evans <pevans(a)redhat.com>
---
gfs2/mkfs/main_mkfs.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index ab525d1..48345b5 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -923,9 +923,17 @@ int main(int argc, char *argv[])
if (opts.confirm && !opts.override)
are_you_sure();
- if (!S_ISREG(opts.dev.stat.st_mode) && opts.discard)
+ if (!S_ISREG(opts.dev.stat.st_mode) && opts.discard) {
+ if (!opts.quiet) {
+ printf("%s", _("Discarding device contents (may take a while on large devices): "));
+ fflush(stdout);
+ }
discard_blocks(opts.dev.fd, opts.dev.size, opts.debug);
+ if (!opts.quiet)
+ printf("%s", _("Done\n"));
+ }
+
error = place_rgrps(&sbd, rgs, &opts);
if (error) {
fprintf(stderr, _("Failed to build resource groups\n"));
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=cf30857d5c…
Commit: cf30857d5cfc236f382b578d8820e1e0f72945b7
Parent: 0d899f6e8d0301b7fb017d374b3b7bf61b53260e
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Oct 12 15:43:03 2015 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Tue Oct 13 13:24:55 2015 +0100
libgfs2: Return the rgrp count in lgfs2_rgrps_plan()
lgfs2_rgrps_plan() previously returned one of the rgrp sizes
specifically so that gfs2_grow could check it. This check was also done
inside the function so the return value would always be 0 when the rgrp
size was too small anyway (really this means that there's not enough
space in which to place sensibly sized rgrps). As returning 0 is
sufficient to pass back the same information, we can return the resource
group count from lgfs2_rgrps_plan() instead, as that is a more useful
value in general.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/rgrp.c | 7 +++----
gfs2/mkfs/main_grow.c | 8 +++-----
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index 2a55523..c20aa1f 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -302,8 +302,8 @@ uint32_t lgfs2_rgrp_align_len(const lgfs2_rgrps_t rgs, uint32_t len)
* rgs: The resource groups descriptor
* space: The number of remaining blocks to be allocated
* tgtsize: The target resource group size in blocks
- * Returns the larger of the calculated resource group sizes, in blocks, or 0
- * if the smaller would be less than GFS2_MIN_RGSIZE.
+ * Returns the number of resource groups planned to fit in the given space, or
+ * 0 if the smallest resource group would be smaller than GFS2_MIN_RGSIZE.
*/
uint32_t lgfs2_rgrps_plan(const lgfs2_rgrps_t rgs, uint64_t space, uint32_t tgtsize)
{
@@ -352,11 +352,10 @@ uint32_t lgfs2_rgrps_plan(const lgfs2_rgrps_t rgs, uint64_t space, uint32_t tgts
/* Once we've reached this point,
(plan[0].num * plan[0].len) + (plan[1].num * plan[1].len)
will be less than one adjustment smaller than 'space'. */
-
if (rgs->plan[0].len < minlen)
return 0;
- return rgs->plan[0].len;
+ return rgs->plan[0].num + rgs->plan[1].num;
}
/**
diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index 860c319..173466c 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -32,7 +32,6 @@
static uint64_t override_device_size = 0;
static int test = 0;
static uint64_t fssize = 0, fsgrowth;
-static unsigned int rgsize = 0;
int print_level = MSG_NOTICE;
extern int create_new_inode(struct gfs2_sbd *sdp);
@@ -315,7 +314,6 @@ static void print_info(struct gfs2_sbd *sdp, char *device, char *mnt_path)
log_notice("FS: %-25s%s\n", _("Device:"), device);
log_notice("FS: %-25s%llu (0x%llx)\n", _("Size:"),
(unsigned long long)fssize, (unsigned long long)fssize);
- log_notice("FS: %-25s%u (0x%x)\n", _("New resource group size:"), rgsize, rgsize);
log_notice("DEV: %-24s%llu (0x%llx)\n", _("Length:"),
(unsigned long long)sdp->device.length,
(unsigned long long)sdp->device.length);
@@ -359,7 +357,7 @@ int main(int argc, char *argv[])
sdp->qcsize = GFS2_DEFAULT_QCSIZE;
sdp->md.journals = 1;
decode_arguments(argc, argv, sdp);
-
+
for(; (argc - optind) > 0; optind++) {
struct metafs mfs = {0};
struct mntent *mnt;
@@ -444,8 +442,8 @@ int main(int argc, char *argv[])
goto out;
}
fsgrowth = (sdp->device.length - fssize);
- rgsize = lgfs2_rgrps_plan(rgs, fsgrowth, ((GFS2_MAX_RGSIZE << 20) / sdp->bsize));
- if (rgsize < ((GFS2_MIN_RGSIZE << 20) / sdp->bsize)) {
+ rgcount = lgfs2_rgrps_plan(rgs, fsgrowth, ((GFS2_MAX_RGSIZE << 20) / sdp->bsize));
+ if (rgcount == 0) {
log_err( _("The calculated resource group size is too small.\n"));
log_err( _("%s has not grown.\n"), argv[optind]);
error = -1;
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=e375d00ed561c…
Commit: e375d00ed561ce3977b9975fa6cdcae72007e382
Parent: 06116f1663094f0dfad88e9285ebd86d13f46248
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri Jun 26 12:18:59 2015 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Oct 8 09:46:08 2015 -0500
fsck.gfs2: Change duptree structure to have generic flags
This patch does not change any functionality. It merely changes the
specialized first_ref_found flag to a flag within a multi-flag var.
rhbz#1206149
---
gfs2/fsck/fsck.h | 4 +++-
gfs2/fsck/util.c | 9 ++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h
index ddabf79..5f15894 100644
--- a/gfs2/fsck/fsck.h
+++ b/gfs2/fsck/fsck.h
@@ -51,9 +51,11 @@ struct dir_status {
uint32_t entry_count;
};
+#define DUPFLAG_REF1_FOUND 1 /* Has the original reference been found? */
+
struct duptree {
struct osi_node node;
- int first_ref_found; /* Has the original reference been found? */
+ int dup_flags;
int refs;
uint64_t block;
osi_list_t ref_inode_list; /* list of inodes referencing a dup block */
diff --git a/gfs2/fsck/util.c b/gfs2/fsck/util.c
index 05989fe..6039fe3 100644
--- a/gfs2/fsck/util.c
+++ b/gfs2/fsck/util.c
@@ -180,7 +180,6 @@ static struct duptree *gfs2_dup_set(uint64_t dblock, int create)
dt->block = dblock;
dt->refs = 1; /* reference 1 is actually the reference we need to
discover in pass1b. */
- dt->first_ref_found = 0;
osi_list_init(&dt->ref_inode_list);
osi_list_init(&dt->ref_invinode_list);
osi_link_node(&dt->node, parent, newn);
@@ -245,7 +244,7 @@ int add_duplicate_ref(struct gfs2_inode *ip, uint64_t block,
/* If we found the duplicate reference but we've already discovered
the first reference (in pass1b) and the other references in pass1,
we don't need to count it, so just return. */
- if (dt->first_ref_found)
+ if (dt->dup_flags & DUPFLAG_REF1_FOUND)
return meta_is_good;
/* Check for a previous reference to this duplicate */
@@ -257,7 +256,7 @@ int add_duplicate_ref(struct gfs2_inode *ip, uint64_t block,
that case, we don't want to be confused and consider this second
reference the same as the first. If we do, we'll never be able to
resolve it. The first reference can't be the second reference. */
- if (id && first && !dt->first_ref_found) {
+ if (id && first && !(dt->dup_flags & DUPFLAG_REF1_FOUND)) {
log_info(_("Original reference to block %llu (0x%llx) was "
"previously found to be bad and deleted.\n"),
(unsigned long long)block,
@@ -266,7 +265,7 @@ int add_duplicate_ref(struct gfs2_inode *ip, uint64_t block,
"(0x%llx) the first reference.\n"),
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)ip->i_di.di_num.no_addr);
- dt->first_ref_found = 1;
+ dt->dup_flags |= DUPFLAG_REF1_FOUND;
return meta_is_good;
}
@@ -275,7 +274,7 @@ int add_duplicate_ref(struct gfs2_inode *ip, uint64_t block,
reference, we don't want to increment the reference count because
it's already accounted for. */
if (first) {
- dt->first_ref_found = 1;
+ dt->dup_flags |= DUPFLAG_REF1_FOUND;
dups_found_first++; /* We found another first ref. */
} else {
dt->refs++;