UBIFS: fix budgeting calculations

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Friday, August 15, 2008 - 2:59 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=182854...
Commit:     182854b46f9feb6f1b03abe747bb2beeebf2adb0
Parent:     ce769caa50a3fc835b4fc1a6e1463ada127a2e8a
Author:     Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
AuthorDate: Fri Jul 18 18:54:29 2008 +0300
Committer:  Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
CommitDate: Wed Aug 13 11:20:05 2008 +0300

    UBIFS: fix budgeting calculations
    
    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 |    5 +++--
 fs/ubifs/dir.c    |    3 +--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c
index d81fb9e..12a1717 100644
--- a/fs/ubifs/budget.c
+++ b/fs/ubifs/budget.c
@@ -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);
 }
 
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index e90374b..a79e850 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -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
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
UBIFS: fix budgeting calculations, Linux Kernel Mailing List..., (Fri Aug 15, 2:59 pm)