linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tao Ma <tm@tao.ma>
To: Lukas Czerner <lczerner@redhat.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH v2] ext3: Adjust trim start with first_data_block.
Date: Fri, 21 Jan 2011 21:59:34 +0800	[thread overview]
Message-ID: <4D399146.3050501@tao.ma> (raw)
In-Reply-To: <alpine.LFD.2.00.1101211131030.3275@dhcp-lab-213.englab.brq.redhat.com>

On 01/21/2011 06:36 PM, Lukas Czerner wrote:
> On Fri, 21 Jan 2011, 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
>>
>> Cc: Jan Kara<jack@suse.cz>
>> Cc: Lukas Czerner<lczerner@redhat.com>
>> Signed-off-by: Tao Ma<boyu.mt@taobao.com>
>> ---
>>   fs/ext3/balloc.c |    7 ++-----
>>   1 files changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
>> index 971e1bd..13bfebe 100644
>> --- a/fs/ext3/balloc.c
>> +++ b/fs/ext3/balloc.c
>> @@ -2091,7 +2091,8 @@ int ext3_trim_fs(struct super_block *sb, struct fstrim_range *range)
>>   	ext3_fsblk_t max_blks = le32_to_cpu(es->s_blocks_count);
>>   	int ret = 0;
>>
>> -	start = range->start>>  sb->s_blocksize_bits;
>> +	start = (range->start>>  sb->s_blocksize_bits) +
>> +		le32_to_cpu(es->s_first_data_block);
>>   	len = range->len>>  sb->s_blocksize_bits;
>>   	minlen = range->minlen>>  sb->s_blocksize_bits;
>>   	trimmed = 0;
>> @@ -2100,10 +2101,6 @@ int ext3_trim_fs(struct super_block *sb, struct fstrim_range *range)
>>   		return -EINVAL;
>>   	if (start>= max_blks)
>>   		goto out;
>> -	if (start<  le32_to_cpu(es->s_first_data_block)) {
>> -		len -= le32_to_cpu(es->s_first_data_block) - start;
>> -		start = le32_to_cpu(es->s_first_data_block);
>> -	}
>>   	if (start + len>  max_blks)
>>   		len = max_blks - start;
>>
>>
> Hi,
>
> Thanks for this patch, I was going to do this, but I am quite busy right
> now. Can you do it for ext4 as well ?
yes, I will send another patch for ext4.

Regards,
Tao

  reply	other threads:[~2011-01-21 13:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-19  9:49 [PATCH] ext3: fix trim length underflow with small trim length Tao Ma
2011-01-19 10:42 ` Lukas Czerner
2011-01-19 11:39   ` Jan Kara
2011-01-21  2:52     ` [PATCH v2] ext3: Adjust trim start with first_data_block Tao Ma
2011-01-21 10:36       ` Lukas Czerner
2011-01-21 13:59         ` Tao Ma [this message]
2011-01-21 15:00       ` Jan Kara
2011-01-19 13:50   ` [PATCH] ext3: fix trim length underflow with small trim length Tao Ma

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=4D399146.3050501@tao.ma \
    --to=tm@tao.ma \
    --cc=lczerner@redhat.com \
    --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).