* [PATCH] ext4: use s_extent_max_zeroout_kb value as number of kb
@ 2013-03-12 16:36 Lukas Czerner
2013-03-12 16:45 ` Theodore Ts'o
0 siblings, 1 reply; 3+ messages in thread
From: Lukas Czerner @ 2013-03-12 16:36 UTC (permalink / raw)
To: linux-ext4; +Cc: wenqing.lz, Lukas Czerner
Currently when converting extent to initialized, we have to decide
whether to zeroout part/all of the uninitialized extent in order to
avoid extent tree growing rapidly.
The decision is made by comparing the size of the extent with the
configurable value s_extent_max_zeroout_kb which is in kibibytes units.
However when converting it to number of blocks we currently use it as it
was in bytes. This is obviously bug and it will result in ext4 _never_
zeroout extents, but rather always split and convert parts to
initialized while leaving the rest uninitialized in default setting.
Fix this by using s_extent_max_zeroout_kb as kibibytes.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
fs/ext4/extents.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index cac80120..aeb80bc 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3227,7 +3227,7 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
if (EXT4_EXT_MAY_ZEROOUT & split_flag)
max_zeroout = sbi->s_extent_max_zeroout_kb >>
- inode->i_sb->s_blocksize_bits;
+ (inode->i_sb->s_blocksize_bits - 10);
/* If extent is less than s_max_zeroout_kb, zeroout directly */
if (max_zeroout && (ee_len <= max_zeroout)) {
--
1.7.7.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: use s_extent_max_zeroout_kb value as number of kb
2013-03-12 16:36 [PATCH] ext4: use s_extent_max_zeroout_kb value as number of kb Lukas Czerner
@ 2013-03-12 16:45 ` Theodore Ts'o
2013-03-13 6:53 ` Lukáš Czerner
0 siblings, 1 reply; 3+ messages in thread
From: Theodore Ts'o @ 2013-03-12 16:45 UTC (permalink / raw)
To: Lukas Czerner; +Cc: linux-ext4, wenqing.lz
Thanks, applied.
I'm on the fence about whether to submit this after -rc2 or not.
This appears to make potential bug much rarer, and it's a trivial
patch to backport, but it does make rather large changes in how we
handle fragmented filesystem. (For the better, but it's a large
change, and it is getting rather late in the season.)
I'm going to include in the dev branch for now, and give it all a good
instensive testing, but there may be some patches in dev that may get
deferred to the next merge window before I send a pull request to
Linus (probably during the coming weekend).
Folks should feel free to propose patches they think should wait for
the next merge window.
- Ted
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: use s_extent_max_zeroout_kb value as number of kb
2013-03-12 16:45 ` Theodore Ts'o
@ 2013-03-13 6:53 ` Lukáš Czerner
0 siblings, 0 replies; 3+ messages in thread
From: Lukáš Czerner @ 2013-03-13 6:53 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: Lukas Czerner, linux-ext4, wenqing.lz
On Tue, 12 Mar 2013, Theodore Ts'o wrote:
> Date: Tue, 12 Mar 2013 12:45:11 -0400
> From: Theodore Ts'o <tytso@mit.edu>
> To: Lukas Czerner <lczerner@redhat.com>
> Cc: linux-ext4@vger.kernel.org, wenqing.lz@taobao.com
> Subject: Re: [PATCH] ext4: use s_extent_max_zeroout_kb value as number of kb
>
> Thanks, applied.
>
> I'm on the fence about whether to submit this after -rc2 or not.
> This appears to make potential bug much rarer, and it's a trivial
> patch to backport, but it does make rather large changes in how we
> handle fragmented filesystem. (For the better, but it's a large
> change, and it is getting rather late in the season.)
>
> I'm going to include in the dev branch for now, and give it all a good
> instensive testing, but there may be some patches in dev that may get
> deferred to the next merge window before I send a pull request to
> Linus (probably during the coming weekend).
>
> Folks should feel free to propose patches they think should wait for
> the next merge window.
>
> - Ted
Hi Ted,
in my opinion this should go in sooner rather than later, because
even though it changes the behaviour quite significantly, it also
brings back the old (expected) behaviour which has been changed by
accident with that bug.
Anyway, I am going to run couple of more tests with that patch as
well.
Thanks!
-Lukas
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-13 6:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-12 16:36 [PATCH] ext4: use s_extent_max_zeroout_kb value as number of kb Lukas Czerner
2013-03-12 16:45 ` Theodore Ts'o
2013-03-13 6:53 ` Lukáš Czerner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox