ext4_balloc: fix not revoking any blocks when freeing blocks.
authorngkaho1234 <ngkaho1234@gmail.com>
Sun, 24 Apr 2016 01:05:26 +0000 (01:05 +0000)
committerngkaho1234 <ngkaho1234@gmail.com>
Sun, 24 Apr 2016 01:05:26 +0000 (01:05 +0000)
src/ext4_balloc.c

index 619bee5c985fc531356fac5d60ddd8f98db1f132..4b17c29420aff352ec3668c0e55d4d3da75c8657 100644 (file)
@@ -232,6 +232,7 @@ int ext4_balloc_free_blocks(struct ext4_inode_ref *inode_ref,
                            ext4_fsblk_t first, uint32_t count)
 {
        int rc = EOK;
+       uint32_t blk_cnt = count;
        struct ext4_fs *fs = inode_ref->fs;
        struct ext4_sblock *sb = &fs->sb;
 
@@ -331,7 +332,7 @@ int ext4_balloc_free_blocks(struct ext4_inode_ref *inode_ref,
        }
 
        uint32_t i;
-       for (i = 0;i < count;i++) {
+       for (i = 0;i < blk_cnt;i++) {
                rc = ext4_trans_try_revoke_block(fs->bdev, first + i);
                if (rc != EOK)
                        return rc;