Skip to contentSkip to conversation

ext4: Remove unneeded BUG_ON() in ext4_move_extents()

PATCH In review Akira Fujita 3 participants 4 messages Sep 2, 2009 – Sep 6, 2009 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 ext4: Remove unneeded BUG_ON() in ext4_move_extents()

ext4: Remove unneeded BUG_ON() in ext4_move_extents()

From: Akira Fujita <[email protected]>

ext4_move_extents() checks with BUG_ON() whether
the exchanged blocks count accords with request blocks count. But, if the target range (orig_start + len) includes sparse block(s), 'moved_len' (exchanged blocks count) does not accord with 'len' (request blocks count),
since sparse block is not counted in 'moved_len'. Therefore we hit BUG_ON(), though it succeeded.

---
 fs/ext4/move_extent.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
fs/ext4/move_extent.c +0 -2
index 60ed567..643156a 100644
@@ -1323,8 +1323,5 @@ out2:
 	if (ret)
 		return ret;
 
-	/* All of the specified blocks must be exchanged in succeed */
-	BUG_ON(*moved_len != len);
#1 lore raw

2009/9/2 Akira Fujita <[email protected]>:

Quoted 11 lines

ext4: Remove unneeded BUG_ON() in ext4_move_extents()

From: Akira Fujita <[email protected]>

ext4_move_extents() checks with BUG_ON() whether
the exchanged blocks count accords with request blocks count. But, if the target range (orig_start + len) includes sparse block(s), 'moved_len' (exchanged blocks count) does not accord with 'len' (request blocks count),
since sparse block is not counted in 'moved_len'. Therefore we hit BUG_ON(), though it succeeded.

I can confirm the bug in my test cases too.

Quoted 24 lines

---
 fs/ext4/move_extent.c |    3 ---

 1 files changed, 0 insertions(+), 3 deletions(-)
fs/ext4/move_extent.c +0 -4
index 60ed567..643156a 100644
@@ -1323,8 +1323,5 @@ out2:
        if (ret)
                return ret;
 
-       /* All of the specified blocks must be exchanged in succeed */
-       BUG_ON(*moved_len != len);
-
        return 0;
  }
--

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

Signature · 8 lines
Cheers,
Peng Tao
State Key Laboratory of Networking and Switching Technology
Beijing Univ. of Posts and Telecoms.
--
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
#2 lore raw

Hi Peng,

Quoted 5 lines · Peng Tao

2009/9/2 Akira Fujita <[email protected]>:

Quoted 4 lines

ext4: Remove unneeded BUG_ON() in ext4_move_extents()

From: Akira Fujita <[email protected]>

Quoted 8 lines
Quoted 7 lines

ext4_move_extents() checks with BUG_ON() whether
the exchanged blocks count accords with request blocks count. But, if the target range (orig_start + len) includes sparse block(s), 'moved_len' (exchanged blocks count) does not accord with 'len' (request blocks count),
since sparse block is not counted in 'moved_len'. Therefore we hit BUG_ON(), though it succeeded.

I can confirm the bug in my test cases too.

I am looking into the issues you reported before:
http://marc.info/?l=linux-ext4&m=124975192830024&w=2
http://marc.info/?l=linux-ext4&m=124992522305319&w=2

When I send patches to the list, please review and test them.

Regards,
Akira Fujita

maintainer
#3 lore raw
In reply to Akira Fujita
Quoted 11 lines · Akira Fujita

ext4: Remove unneeded BUG_ON() in ext4_move_extents()

From: Akira Fujita <[email protected]>

ext4_move_extents() checks with BUG_ON() whether
the exchanged blocks count accords with request blocks count. But, if the target range (orig_start + len) includes sparse block(s), 'moved_len' (exchanged blocks count) does not accord with 'len' (request blocks count),
since sparse block is not counted in 'moved_len'. Therefore we hit BUG_ON(), though it succeeded.

Added to the ext4 patch queue.

- Ted