projects
/
bluesky.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b1a839
)
Fix a longstanding(?) memory-leak bug when truncating a file.
author
Michael Vrable
<mvrable@cs.ucsd.edu>
Sun, 22 Aug 2010 04:48:50 +0000
(21:48 -0700)
committer
Michael Vrable
<mvrable@cs.ucsd.edu>
Sun, 22 Aug 2010 04:48:50 +0000
(21:48 -0700)
bluesky/file.c
patch
|
blob
|
history
diff --git
a/bluesky/file.c
b/bluesky/file.c
index
94677f6
..
a6f6a15
100644
(file)
--- a/
bluesky/file.c
+++ b/
bluesky/file.c
@@
-93,7
+93,7
@@
void bluesky_file_truncate(BlueSkyInode *inode, uint64_t size)
g_array_set_size(inode->blocks, blocks);
} else if (blocks < inode->blocks->len) {
/* Delete blocks from a file. Must reclaim memory. */
- for (guint i =
inode->blocks->len; i < blocks
; i++) {
+ for (guint i =
blocks; i < inode->blocks->len
; i++) {
BlueSkyBlock *b = &g_array_index(inode->blocks, BlueSkyBlock, i);
if (b->type == BLUESKY_BLOCK_DIRTY)
g_atomic_int_add(&inode->fs->cache_dirty, -1);