cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Paul Evans <pevans@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] mkfs.gfs2: print message about BKLDISCARD ioctl taking a long time
Date: Thu, 24 Sep 2015 19:27:07 +0100	[thread overview]
Message-ID: <1443119227-24367-1-git-send-email-pevans@redhat.com> (raw)

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@redhat.com>
---
 gfs2/mkfs/main_mkfs.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index d3d8edf..005b6f8 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -904,9 +904,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", _("\nDiscarding old blocks (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"));
-- 
1.9.3



             reply	other threads:[~2015-09-24 18:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24 18:27 Paul Evans [this message]
2015-09-25  8:47 ` [Cluster-devel] [PATCH] mkfs.gfs2: print message about BKLDISCARD ioctl taking a long time Andrew Price

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443119227-24367-1-git-send-email-pevans@redhat.com \
    --to=pevans@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).