Comment 18 for bug 321528

Revision history for this message
Theodore Ts'o (tytso) wrote : Re: ext4 defrag / defragment tool in Jaunty - include

You can convert an individual file to use extents by using "chattr +e file1 [...]"; in theory the ioctl used by chattr +e could be added to e4defrags. This functionality was added to chattr after e2fsprogs 1.41.6. The kernel code to support the ioctl has been in the kernel for a long time, but it hasn't gotten much testing. The same thing applies in terms of potential for data loss. It's been lightly tested, but hasn't received a major shakedown, mainly because it hasn't been a high priority. If someone would be willing to do some heavy testing of what happens if the file is sparse, or is being written to at the time, etc., for both chattr +e and e4defrag, or better yet could write some test code which could be added to a regression test suite, please contact the linux-ext4 mailing list at vger.kernel.org. The test effort would be greatly appreciated.