From: Eric Sandeen <sandeen@redhat.com>
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: Thu, 28 Apr 2011 16:05:12 -0500 [thread overview]
Message-ID: <4DB9D688.3080905@redhat.com> (raw)
In-Reply-To: <BANLkTikHomLCTM307W0ergoOX8PH5x_JBA@mail.gmail.com>
On 4/28/11 3:14 PM, Peter Uchno wrote:
> Hello,
> 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. Run "chattr +e baz" a second time, the same thing
> happens. A third time, however, it comes back with:
> "chattr: Input/output error while setting flags on baz"
> and an error in the kernel log:
> attempt to access beyond end of device
> loop1: rw=0, want=204802, limit=204800
> The file is still not using extents and remounting the filesystem
> doesn't seem to change much. Running e2fsck on the filesystem after
> unmounting it comes back with some errors. Letting it fix them and
> then mounting the FS up again shows that the file is now using
> extents.
> I attempted this on an Arch system with both kernels 2.6.37.4 and
> 2.6.38.4 and was able to recreate it by creating a small loopback
> filesystem using dd, making a few files on it, converting the FS to
> ext4 using "tune2fs -O extents,uninit_bg,dir_index /tmp/fs.ext; e2fsck
> -fDC0 /tmp/fs.ext", and then mounting it again as ext4 and attempting
> the conversion to extents with chattr. However, on a debian system
> with kernel 2.6.32.5, it works as intended (chattr +e bar; lsattr bar
> reveals the file converted to extents). I ran strace on the chattr
> command on the Arch system and came up with the following:
>
> http://pastebin.com/EpwhLF3t
> for the first attempt at running the command;
> http://pastebin.com/qB7DiDgF
> for the second try; and
> http://pastebin.com/jjAdPtBr
> for the final attempt.
>
> After doing so, running e2fsck on the filesystem revealed the following:
>
> http://pastebin.com/83q60Wik
>
> And after mounting the filesystem again, the file is now using extents.
>
> My kernel config, if it is of interest, is at:
> http://pastebin.com/uk1Hs53P
>
> I'm using e2fsprogs 1.41.14. The Debian system (where it works
> normally) has e2fsprogs 1.41.12.
>
> I'm not sure what would cause the filesystem to behave in this
> fashion. Does anyone have any insights?
I can't speak directly to the problem because I haven't investigated, but I can tell you that chattr +e foo is probably almost never tested.
If any other ext4 dev does test it, speak up. :)
And I would strongly suggest that if you want an ext4 filesystem, mkfs.ext4 and migratind data to it is the best route to a consistent, featureful, well-tested setup.
-Eric
> Regards,
> Peter
next prev parent reply other threads:[~2011-04-28 21:05 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 [this message]
2011-05-03 13:35 ` Ted 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=4DB9D688.3080905@redhat.com \
--to=sandeen@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.