ext4_bcache: clear BC_DIRTY flag when buffer will be dropped.
authorngkaho1234 <ngkaho1234@gmail.com>
Tue, 24 Nov 2015 15:09:23 +0000 (15:09 +0000)
committerngkaho1234 <ngkaho1234@gmail.com>
Tue, 24 Nov 2015 15:14:46 +0000 (15:14 +0000)
lwext4/ext4_bcache.c

index b3800c890c9880926b13216d32081c051347935a..00be89854bf73d13c3cdff5e32a43bbaf12537e1 100644 (file)
@@ -246,8 +246,10 @@ int ext4_bcache_free(struct ext4_bcache *bc, struct ext4_block *b)
                b->uptodate = true;
        }
        /* Someone might want to drop this buffer from bcache. */
-       if (!b->uptodate)
+       if (!b->uptodate) {
+               ext4_bcache_clear_flag(buf, BC_DIRTY);
                ext4_bcache_clear_flag(buf, BC_UPTODATE);
+       }
 
        /* We are the last one touching this buffer, do the cleanups. */
        if (!buf->refctr) {