Skip to contentSkip to conversation

Ext3: remove a useless check for the function ext3_free_blocks_sb

PATCH In review Wang Shilong 2 participants 2 messages Jan 26, 2013 – Jan 27, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Ext3: remove a useless check for the function ext3_free_blocks_sb

From: Wang Shilong <[email protected]>

Because 'block + count < block' always comes to false, it is useless to have this check, just remove it.

---
 fs/ext3/balloc.c | 1 -
 1 file changed, 1 deletion(-)
fs/ext3/balloc.c +0 -1
index 22548f5..c557f22 100644
@@ -507,7 +507,6 @@ void ext3_free_blocks_sb(handle_t *handle, struct super_block *sb,
 	sbi = EXT3_SB(sb);
 	es = sbi->s_es;
 	if (block < le32_to_cpu(es->s_first_data_block) ||
-	    block + count < block ||
 	    block + count > le32_to_cpu(es->s_blocks_count)) {
 		ext3_error (sb, "ext3_free_blocks",
 			    "Freeing blocks not in datazone - "

-- 1.7.11.7

#1 lore raw
Quoted 4 lines · Wang Shilong

From: Wang Shilong <[email protected]>

Because 'block + count < block' always comes to false, it is useless to have this check, just remove it.

This check can be true if the sum overflows the 32-bit variable it is stored in, so it is not useless...

Cheers, Andreas

Quoted 23 lines

---
fs/ext3/balloc.c | 1 -

1 file changed, 1 deletion(-)
fs/ext3/balloc.c +0 -3
index 22548f5..c557f22 100644
@@ -507,7 +507,6 @@ void ext3_free_blocks_sb(handle_t *handle, struct super_block *sb,
   sbi = EXT3_SB(sb);
   es = sbi->s_es;
   if (block < le32_to_cpu(es->s_first_data_block) ||
-        block + count < block ||
       block + count > le32_to_cpu(es->s_blocks_count)) {
       ext3_error (sb, "ext3_free_blocks",
               "Freeing blocks not in datazone - "
-- 1.7.11.7
 
--

To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html