Skip to content

Commit

Permalink
Fixed memory leak in emubd's out-of-order write emulation
Browse files Browse the repository at this point in the history
We need to decrement the saved block state on sync, when we reset
out-of-order emulation. Otherwise we leak blocks out the wazoo.
  • Loading branch information
geky committed Feb 28, 2024
1 parent fc2aa33 commit 7873d81
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bd/lfs_emubd.c
Expand Up @@ -531,6 +531,7 @@ int lfs_emubd_sync(const struct lfs_config *cfg) {
// emulate out-of-order writes? reset first write, writes
// cannot be out-of-order across sync
if (bd->cfg->powerloss_behavior == LFS_EMUBD_POWERLOSS_OOO) {
lfs_emubd_decblock(bd->ooo_data);
bd->ooo_block = -1;
bd->ooo_data = NULL;
}
Expand Down

0 comments on commit 7873d81

Please sign in to comment.