shithub: lwext4

Download patch

ref: 36523c0a42dede6ea805f0983887d46d4b4079f5
parent: 8f8f6a2297ba630dd1005564cc424ff1811e5545
author: gkostka <kostka.grzegorz@gmail.com>
date: Tue Nov 17 19:46:25 EST 2015

Change assert in ext4_balloc to debug warning message

--- a/lwext4/ext4_balloc.c
+++ b/lwext4/ext4_balloc.c
@@ -227,19 +227,21 @@
 	uint32_t bg_first = ext4_balloc_get_bgid_of_block(sb, first);
 
 	/* Compute indexes */
-	uint32_t block_group_last =
-	    ext4_balloc_get_bgid_of_block(sb, first + count - 1);
+	uint32_t bg_last = ext4_balloc_get_bgid_of_block(sb, first + count - 1);
 
 	if (!ext4_sb_feature_incom(sb, EXT4_FINCOM_FLEX_BG)) {
 		/*It is not possible without flex_bg that blocks are continuous
 		 * and and last block belongs to other bg.*/
-		ext4_assert(ext4_balloc_get_bgid_of_block(sb, first + count - 1)
-			== bg_first);
+		if (bg_last != bg_first) {
+			ext4_dbg(DEBUG_BALLOC, DBG_WARN "FLEX_BG: disabled & "
+				"bg_last: %"PRIu32" bg_first: %"PRIu32"\n",
+				bg_last, bg_first);
+		}
 	}
 
 	/* Load block group reference */
 	struct ext4_block_group_ref bg_ref;
-	while (bg_first <= block_group_last) {
+	while (bg_first <= bg_last) {
 
 		rc = ext4_fs_get_block_group_ref(fs, bg_first, &bg_ref);
 		if (rc != EOK)