linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ted Ts'o <tytso@mit.edu>
To: Tao Ma <tm@tao.ma>
Cc: linux-ext4@vger.kernel.org, Lukas Czerner <lczerner@redhat.com>
Subject: Re: [PATCH] ext4: Adjust trim start with first_data_block.
Date: Fri, 4 Feb 2011 00:40:12 -0500	[thread overview]
Message-ID: <20110204054012.GD2623@thunk.org> (raw)
In-Reply-To: <1295618707-3677-1-git-send-email-tm@tao.ma>

On Fri, Jan 21, 2011 at 10:05:07PM +0800, Tao Ma wrote:
> From: Tao Ma <boyu.mt@taobao.com>
> 
> As we have make the consense in the e-mail[1], the trim start should
> be added with first_data_block. So this patch fulfill it and remove
> the check for start < first_data_block.

> 
> [1] http://www.spinics.net/lists/linux-ext4/msg22737.html
> 

Sorry, I was away at Linux.conf.au and didn't have a chance to respond
this.

Fundamentally I think we need to understand what the arguments to the
trim ioctl is supposed to *mean*.  Are they supposed to be physical
block numbers, or some thing else?  If we just bump everything by the
first_data_block, (which is non-zero only for the 1k case), that will
screw up the length argument, because the userspace program isn't
going to know that (a) the file system is using 1k blocks, and (b) on
ext2/3/4 that means that first_data_block is 1.

So instead of saying that the arguments to trim mean "the data blocks"
--- which is a concept that doesn't really have any meaning to the
caller of the trim ioctl, without forcing it to know a lot more about
the physical layout of filesystems, I think the argument to trim
should be the physical block numbers.

And just as we don't trim blocks that contain data that should be
saved, we should just simply not trim block #0 (the boot block) and
and block #1 (the superblock) on 1k block filesystems, and not trim
block #0 (the boot block as well as the superblock) on 4k block
filesystems.  But we shouldn't be doing this by taking block number
passed to trim and just adding first_data_block to it.

I know a patch to do that has already merged into ext3, but with the
indulgence of the folks on linux-ext4, could we reopen this question?

Thanks,

						- Ted

  reply	other threads:[~2011-02-04  5:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-21 14:05 [PATCH] ext4: Adjust trim start with first_data_block Tao Ma
2011-02-04  5:40 ` Ted Ts'o [this message]
2011-02-05 15:16   ` Tao Ma
2011-02-07 13:03     ` Lukas Czerner

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=20110204054012.GD2623@thunk.org \
    --to=tytso@mit.edu \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tm@tao.ma \
    /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).