linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext2 : Remove redundant condition in ext2_free_blocks()
@ 2008-05-31 18:56 Manish Katiyar
  2008-06-03 12:33 ` Mark Asselstine
  0 siblings, 1 reply; 3+ messages in thread
From: Manish Katiyar @ 2008-05-31 18:56 UTC (permalink / raw)
  To: linux-ext4, linux-fsdevel, kernel-janitors

For two unsigned values the check "block+count < block"  is always
false. Thus the below patch removes that condition.

=============================================================

Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>

--- a/fs/ext2/balloc.c  2008-05-11 23:54:40.000000000 +0530
+++ b/fs/ext2/balloc.c  2008-06-01 00:03:44.000000000 +0530
@@ -499,7 +499,6 @@
        unsigned freed = 0, group_freed;

        if (block < le32_to_cpu(es->s_first_data_block) ||
-           block + count < block ||
            block + count > le32_to_cpu(es->s_blocks_count)) {
                ext2_error (sb, "ext2_free_blocks",
                            "Freeing blocks not in datazone - "


=============================================================

-- 
Thanks & Regards,
********************************************
Manish Katiyar ( http://mkatiyar.googlepages.com )
3rd Floor, Fair Winds Block
EGL Software Park
Off Intermediate Ring Road
Bangalore 560071, India
***********************************************

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext2 : Remove redundant condition in ext2_free_blocks()
  2008-05-31 18:56 [PATCH] ext2 : Remove redundant condition in ext2_free_blocks() Manish Katiyar
@ 2008-06-03 12:33 ` Mark Asselstine
  2008-06-03 13:28   ` Manish Katiyar
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Asselstine @ 2008-06-03 12:33 UTC (permalink / raw)
  To: Manish Katiyar; +Cc: linux-ext4, linux-fsdevel, kernel-janitors

On Sat, May 31, 2008 at 2:56 PM, Manish Katiyar <mkatiyar@gmail.com> wrote:
> For two unsigned values the check "block+count < block"  is always
> false. Thus the below patch removes that condition.
>
Always? What about "ULONG_MAX + 5"? I believe the answer is 4, but I
may be wrong. You might want to rethink this one.

RE/
Mark

> =============================================================
>
> Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
>
> --- a/fs/ext2/balloc.c  2008-05-11 23:54:40.000000000 +0530
> +++ b/fs/ext2/balloc.c  2008-06-01 00:03:44.000000000 +0530
> @@ -499,7 +499,6 @@
>        unsigned freed = 0, group_freed;
>
>        if (block < le32_to_cpu(es->s_first_data_block) ||
> -           block + count < block ||
>            block + count > le32_to_cpu(es->s_blocks_count)) {
>                ext2_error (sb, "ext2_free_blocks",
>                            "Freeing blocks not in datazone - "
>
>
> =============================================================
>
> --
> Thanks & Regards,
> ********************************************
> Manish Katiyar ( http://mkatiyar.googlepages.com )
> 3rd Floor, Fair Winds Block
> EGL Software Park
> Off Intermediate Ring Road
> Bangalore 560071, India
> ***********************************************
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext2 : Remove redundant condition in ext2_free_blocks()
  2008-06-03 12:33 ` Mark Asselstine
@ 2008-06-03 13:28   ` Manish Katiyar
  0 siblings, 0 replies; 3+ messages in thread
From: Manish Katiyar @ 2008-06-03 13:28 UTC (permalink / raw)
  To: Mark Asselstine; +Cc: linux-ext4, linux-fsdevel, kernel-janitors

On Tue, Jun 3, 2008 at 6:03 PM, Mark Asselstine <asselsm@gmail.com> wrote:
> On Sat, May 31, 2008 at 2:56 PM, Manish Katiyar <mkatiyar@gmail.com> wrote:
>> For two unsigned values the check "block+count < block"  is always
>> false. Thus the below patch removes that condition.
>>
> Always? What about "ULONG_MAX + 5"? I believe the answer is 4, but I
> may be wrong. You might want to rethink this one.

Yeah.... it is a total crap patch .... sorry for making the noise.

>
> RE/
> Mark
>
>> =============================================================
>>
>> Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
>>
>> --- a/fs/ext2/balloc.c  2008-05-11 23:54:40.000000000 +0530
>> +++ b/fs/ext2/balloc.c  2008-06-01 00:03:44.000000000 +0530
>> @@ -499,7 +499,6 @@
>>        unsigned freed = 0, group_freed;
>>
>>        if (block < le32_to_cpu(es->s_first_data_block) ||
>> -           block + count < block ||
>>            block + count > le32_to_cpu(es->s_blocks_count)) {
>>                ext2_error (sb, "ext2_free_blocks",
>>                            "Freeing blocks not in datazone - "
>>
>>
>> =============================================================
>>
>> --
>> Thanks & Regards,
>> ********************************************
>> Manish Katiyar ( http://mkatiyar.googlepages.com )
>> 3rd Floor, Fair Winds Block
>> EGL Software Park
>> Off Intermediate Ring Road
>> Bangalore 560071, India
>> ***********************************************
>> --
>> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>



-- 
Thanks & Regards,
********************************************
Manish Katiyar ( http://mkatiyar.googlepages.com )
3rd Floor, Fair Winds Block
EGL Software Park
Off Intermediate Ring Road
Bangalore 560071, India
***********************************************

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-03 13:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-31 18:56 [PATCH] ext2 : Remove redundant condition in ext2_free_blocks() Manish Katiyar
2008-06-03 12:33 ` Mark Asselstine
2008-06-03 13:28   ` Manish Katiyar

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).