From: Ted Ts'o <tytso@mit.edu>
To: Peter Uchno <peter.uchno@gmail.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Strange behavior when attempting to convert a file to extents using chattr
Date: Tue, 3 May 2011 09:35:08 -0400 [thread overview]
Message-ID: <20110503133508.GA6462@thunk.org> (raw)
In-Reply-To: <BANLkTikHomLCTM307W0ergoOX8PH5x_JBA@mail.gmail.com>
On Thu, Apr 28, 2011 at 04:14:59PM -0400, Peter Uchno wrote:
> I recently converted an ext3 filesystem to ext4 in the hopes of
> performance increases. However, I ran into a snag:
>
> In theory, chattr can be used to convert a file to extents using
> "chattr +e foo". However, on my system (Archlinux, kernel 2.6.37.4),
> the behavior of this command is unexpected. Given a file baz created
> when the filesystem was still ext3 (and thus not using extents),
> "chattr +e baz" returns zero but "lsattr baz" reveals the file is not
> using extents.
I found the problem; we were failing to set the extents flag at the
conclusion of the migration run. The following patch should fix
things. Thanks for reporting the problem, and my apologies for not
catching this further. (/me makes a mental note to create an xfstests
test for this case.)
- Ted
>From 74e4e6db38918620bdf8a46e94982ead2b228d43 Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <tytso@mit.edu>
Date: Tue, 3 May 2011 09:34:42 -0400
Subject: [PATCH] ext4: set extents flag when migrating file to use extents
Fix a typo that was introduced in commit 07a038245b (in 2.6.36) which
caused the extents flag not to be set at the conclusion of converting
an inode to use extents.
Reported-by: Peter Uchno <peter.uchno@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
fs/ext4/migrate.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
index 92816b4..b57b98f 100644
--- a/fs/ext4/migrate.c
+++ b/fs/ext4/migrate.c
@@ -376,7 +376,7 @@ static int ext4_ext_swap_inode_data(handle_t *handle, struct inode *inode,
* We have the extent map build with the tmp inode.
* Now copy the i_data across
*/
- ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS);
+ ext4_set_inode_flag(inode, EXT4_INODE_EXTENTS);
memcpy(ei->i_data, tmp_ei->i_data, sizeof(ei->i_data));
/*
--
1.7.3.1
prev parent reply other threads:[~2011-05-03 13:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-28 20:14 Strange behavior when attempting to convert a file to extents using chattr Peter Uchno
2011-04-28 21:05 ` Eric Sandeen
2011-05-03 13:35 ` Ted Ts'o [this message]
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=20110503133508.GA6462@thunk.org \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=peter.uchno@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).