]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
UBIFS: fix budgeting calculations
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 18 Jul 2008 15:54:29 +0000 (18:54 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 13 Aug 2008 08:20:05 +0000 (11:20 +0300)
The 'ubifs_release_dirty_inode_budget()' was buggy and incorrectly
freed the budget, which led to not freeing all dirty data budget.
This patch fixes that.

Also, this patch fixes ubifs_mkdir() which passed 1 in dirty_ino_d,
which makes no sense. Well, it is harmless though.

Also, add few more useful assertions. And improve few debugging
messages.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
fs/ubifs/budget.c
fs/ubifs/dir.c

index d81fb9ed2b8e28e5e0317d5ca9a626cd08762b3e..12a1717db87c40d5c9f043503b7d8955e0be3d16 100644 (file)
@@ -686,9 +686,10 @@ void ubifs_convert_page_budget(struct ubifs_info *c)
 void ubifs_release_dirty_inode_budget(struct ubifs_info *c,
                                      struct ubifs_inode *ui)
 {
-       struct ubifs_budget_req req = {.dd_growth = c->inode_budget,
-                                      .dirtied_ino_d = ui->data_len};
+       struct ubifs_budget_req req;
 
+       memset(&req, 0, sizeof(struct ubifs_budget_req));
+       req.dd_growth = c->inode_budget + ui->data_len;
        ubifs_release_budget(c, &req);
 }
 
index e90374be7d3b7833038af478efd32ac1db73f69a..a79e850fee6dce4de5f69c5e8eb6e7b8d3b1d079 100644 (file)
@@ -727,8 +727,7 @@ static int ubifs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        struct ubifs_inode *dir_ui = ubifs_inode(dir);
        struct ubifs_info *c = dir->i_sb->s_fs_info;
        int err, sz_change = CALC_DENT_SIZE(dentry->d_name.len);
-       struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
-                                       .dirtied_ino_d = 1 };
+       struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1 };
 
        /*
         * Budget request settings: new inode, new direntry and changing parent