linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Ext4 Developers List <linux-ext4@vger.kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH 8/9] ext4: log a resize update to the console every 10 seconds
Date: Thu, 13 Sep 2012 18:49:15 -0400	[thread overview]
Message-ID: <1347576556-5725-9-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <1347576556-5725-1-git-send-email-tytso@mit.edu>

For very long online resizes, a periodic update to the console log is
helpful for debugging and for progress reporting.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 fs/ext4/resize.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 5932ab5..3c9367b 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1869,6 +1869,7 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
 	ext4_group_t n_group;
 	ext4_fsblk_t o_blocks_count;
 	ext4_fsblk_t n_blocks_count_retry = 0;
+	unsigned long last_update_time = 0;
 	int err = 0, flexbg_size = 1 << sbi->s_log_groups_per_flex;
 	int meta_bg;
 
@@ -1977,6 +1978,13 @@ retry:
 	 */
 	while (ext4_setup_next_flex_gd(sb, flex_gd, n_blocks_count,
 					      flexbg_size)) {
+		if (jiffies - last_update_time > HZ * 10) {
+			if (last_update_time)
+				ext4_msg(sb, KERN_INFO,
+					 "resized to %llu blocks",
+					 ext4_blocks_count(es));
+			last_update_time = jiffies;
+		}
 		if (ext4_alloc_group_tables(sb, flex_gd, flexbg_size) != 0)
 			break;
 		err = ext4_flex_group_add(sb, resize_inode, flex_gd);
-- 
1.7.12.rc0.22.gcdd159b


  parent reply	other threads:[~2012-09-13 23:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-13 22:49 [PATCH 0/9 v3] meta_bg online resize patches Theodore Ts'o
2012-09-13 22:49 ` [PATCH 1/9] ext4: don't copy non-existent gdt blocks when resizing Theodore Ts'o
2012-09-13 22:49 ` [PATCH 2/9] ext4: avoid duplicate writes of the backup bg descriptor blocks Theodore Ts'o
2012-09-13 22:49 ` [PATCH 3/9] ext4: grow the s_flex_groups array as needed when resizing Theodore Ts'o
2012-09-13 22:49 ` [PATCH 4/9] ext4: grow the s_group_info array as needed Theodore Ts'o
2012-09-13 22:49 ` [PATCH 5/9] ext4: add online resizing support for meta_bg and 64-bit file systems Theodore Ts'o
2012-09-13 22:49 ` [PATCH 6/9] ext4: set bg_itable_unused when resizing Theodore Ts'o
2012-09-13 22:49 ` [PATCH 7/9] ext4: convert file system to meta_bg if needed during resizing Theodore Ts'o
2012-09-13 22:49 ` Theodore Ts'o [this message]
2012-09-13 22:49 ` [PATCH 9/9] ext4: advertise the fact that the kernel supports meta_bg resizing Theodore Ts'o

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=1347576556-5725-9-git-send-email-tytso@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    /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).