linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Joseph D. Wagner" <joe@josephdwagner.info>
To: <linux-ext4@vger.kernel.org>
Subject: RFC: [Bug 968876] e4defrag incorrectly calculates optimum extents
Date: Mon, 03 Jun 2013 09:12:09 -0700	[thread overview]
Message-ID: <1307022e77a0853de8c417ff43128908@josephdwagner.info> (raw)

https://bugzilla.redhat.com/show_bug.cgi?id=968876

The "Total/best extents" calculation for done in the e4defrag program 
doesn't seems to not consider the limit of 32768 file system blocks (see 
/usr/src/linux/fs/ext4/ext4_extents.h comment EXT_INIT_MAX_LEN) in an 
extent when computing the "best" value. It seems to presume 2G is the 
best extent size, but on a file system with a 4kb block size the largest 
available extent is 128M not 2G.

(The best extent size calculation in e4defrag seems to be based on 
block group size but the underlying implementation in the kernel is 
limited to a __le16 blocks and uses up one whole bit of that to flag 
whether the extent is initialized, which actually produces a one-block 
perturbation in the actual limit based on how the extent was allocated 
(e.g. whether falloc used FS_KEEP_SIZE or not), go go gadget perturbed 
math. 8-)).

Example:
-rw-r--r-- 1 rwhite rwhite 5.0G Jun 13 16:28 CentOS.qcow2

yeilds output: (where "/3" is wrong).

Total/best extents 152/3

Proposed patch available here:
http://pastebin.com/9XTFcVM0

Joseph D. Wagner

                 reply	other threads:[~2013-06-03 16:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1307022e77a0853de8c417ff43128908@josephdwagner.info \
    --to=joe@josephdwagner.info \
    --cc=linux-ext4@vger.kernel.org \
    /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).