From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Evans Date: Thu, 24 Sep 2015 19:27:07 +0100 Subject: [Cluster-devel] [PATCH] mkfs.gfs2: print message about BKLDISCARD ioctl taking a long time Message-ID: <1443119227-24367-1-git-send-email-pevans@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --- 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