Skip to content

Commit b248eaf

Browse files
Zhihao Chengrichardweinberger
authored andcommitted
ubifs: Fix wrong dirty space budget for dirty inode
Each dirty inode should reserve 'c->bi.inode_budget' bytes in space budget calculation. Currently, space budget for dirty inode reports more space than what UBIFS actually needs to write. Fixes: 1e51764 ("UBIFS: add new flash file system") Signed-off-by: Zhihao Cheng <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent c04cc68 commit b248eaf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ubifs/budget.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ static int calc_dd_growth(const struct ubifs_info *c,
400400
dd_growth = req->dirtied_page ? c->bi.page_budget : 0;
401401

402402
if (req->dirtied_ino)
403-
dd_growth += c->bi.inode_budget << (req->dirtied_ino - 1);
403+
dd_growth += c->bi.inode_budget * req->dirtied_ino;
404404
if (req->mod_dent)
405405
dd_growth += c->bi.dent_budget;
406406
dd_growth += req->dirtied_ino_d;

0 commit comments

Comments
 (0)