shithub: lwext4

Download patch

ref: 3424e6d5c6ee304984d05a62f70cdb40a66274b1
parent: fbc87b38d6c36aeec6bae1c67752e1f059953f20
author: ngkaho1234 <ngkaho1234@gmail.com>
date: Mon Dec 28 08:15:26 EST 2015

ext4_bcache: remove buffer from LRU tree when it will be dropped.

--- a/lwext4/ext4_bcache.c
+++ b/lwext4/ext4_bcache.c
@@ -163,10 +163,10 @@
 		ext4_dbg(DEBUG_BCACHE, DBG_WARN "Buffer is still referenced. "
 				"lba: %" PRIu64 ", refctr: %" PRIu32 "\n",
 				buf->lba, buf->refctr);
-	}
+	} else
+		RB_REMOVE(ext4_buf_lru, &bc->lru_root, buf);
 
 	RB_REMOVE(ext4_buf_lba, &bc->lba_root, buf);
-	RB_REMOVE(ext4_buf_lru, &bc->lru_root, buf);
 
 	/*Forcibly drop dirty buffer.*/
 	if (ext4_bcache_test_flag(buf, BC_DIRTY))