From: Theodore Ts'o <tytso@mit.edu>
To: Ext4 Developers List <linux-ext4@vger.kernel.org>
Cc: Yongqiang Yang <xiaoqiangnk@gmail.com>,
"Theodore Ts'o" <tytso@mit.edu>,
stable@vger.kernel.org
Subject: [PATCH 1/9] ext4: don't copy non-existent gdt blocks when resizing
Date: Thu, 13 Sep 2012 18:49:08 -0400 [thread overview]
Message-ID: <1347576556-5725-2-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <1347576556-5725-1-git-send-email-tytso@mit.edu>
From: Yongqiang Yang <xiaoqiangnk@gmail.com>
The resize code was copying blocks at the beginning of each block
group in order to copy the superblock and block group descriptor table
(gdt) blocks. This was, unfortunately, being done even for block
groups that did not have super blocks or gdt blocks. This is a
complete waste of perfectly good I/O bandwidth, to skip writing those
blocks for sparse bg's.
Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
---
fs/ext4/resize.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 591f4bd..a0ee26c 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -456,6 +456,9 @@ static int setup_new_flex_group_blocks(struct super_block *sb,
gdblocks = ext4_bg_num_gdb(sb, group);
start = ext4_group_first_block_no(sb, group);
+ if (!ext4_bg_has_super(sb, group))
+ goto handle_itb;
+
/* Copy all of the GDT blocks into the backup in this group */
for (j = 0, block = start + 1; j < gdblocks; j++, block++) {
struct buffer_head *gdb;
@@ -498,6 +501,7 @@ static int setup_new_flex_group_blocks(struct super_block *sb,
goto out;
}
+handle_itb:
/* Initialize group tables of the grop @group */
if (!(bg_flags[i] & EXT4_BG_INODE_ZEROED))
goto handle_bb;
--
1.7.12.rc0.22.gcdd159b
next prev parent reply other threads:[~2012-09-13 22:49 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 ` Theodore Ts'o [this message]
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 ` [PATCH 8/9] ext4: log a resize update to the console every 10 seconds Theodore Ts'o
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-2-git-send-email-tytso@mit.edu \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=xiaoqiangnk@gmail.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).