diff options
| author | ngkaho1234 <ngkaho1234@gmail.com> | 2015-12-20 10:26:24 +0000 |
|---|---|---|
| committer | ngkaho1234 <ngkaho1234@gmail.com> | 2015-12-20 10:26:24 +0000 |
| commit | 3cd8523e39ddd70f45bdff22696e411e018259fa (patch) | |
| tree | b037e6e926a4247150c336edefbd37cfb07bbfc1 | |
| parent | 79b5a450046b433f7c6080396ed0871f1b76ba28 (diff) | |
ext4_blockdev: flush data only when buffer is dirty and up-to-date.
| -rw-r--r-- | lwext4/ext4_blockdev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lwext4/ext4_blockdev.c b/lwext4/ext4_blockdev.c index 88e47d1..110050c 100644 --- a/lwext4/ext4_blockdev.c +++ b/lwext4/ext4_blockdev.c @@ -141,7 +141,8 @@ int ext4_block_flush_buf(struct ext4_blockdev *bdev, struct ext4_buf *buf) int r; struct ext4_bcache *bc = bdev->bc; - if (ext4_bcache_test_flag(buf, BC_DIRTY)) { + if (ext4_bcache_test_flag(buf, BC_DIRTY) && + ext4_bcache_test_flag(buf, BC_UPTODATE)) { r = ext4_blocks_set_direct(bdev, buf->data, buf->lba, 1); if (r) { |
