ext4_bcache: remove buffer from LRU tree when it will be dropped.
authorngkaho1234 <ngkaho1234@gmail.com>
Mon, 28 Dec 2015 13:15:26 +0000 (13:15 +0000)
committergkostka <kostka.grzegorz@gmail.com>
Mon, 28 Dec 2015 13:28:55 +0000 (14:28 +0100)
lwext4/ext4_bcache.c

index a8b1855ccda08ac88d4501559a6907d02909e3ca..628735ab659fe38b5aac1e7fda1f660210f6fafb 100644 (file)
@@ -163,10 +163,10 @@ void ext4_bcache_drop_buf(struct ext4_bcache *bc, struct ext4_buf *buf)
                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))