UBIFS: align inode data to eight
UBIFS aligns node lengths to 8, so budgeting has to do the same. Well, direntry, inode, and page budgets are already aligned, but not inode data budget (e.g., data in special devices or symlinks). Do this for inode data as well. Also, add corresponding debugging checks. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
@@ -890,7 +890,7 @@ static int do_setattr(struct ubifs_info *c, struct inode *inode,
|
||||
loff_t new_size = attr->ia_size;
|
||||
struct ubifs_inode *ui = ubifs_inode(inode);
|
||||
struct ubifs_budget_req req = { .dirtied_ino = 1,
|
||||
.dirtied_ino_d = ui->data_len };
|
||||
.dirtied_ino_d = ALIGN(ui->data_len, 8) };
|
||||
|
||||
err = ubifs_budget_space(c, &req);
|
||||
if (err)
|
||||
@@ -1052,7 +1052,7 @@ static int update_mctime(struct ubifs_info *c, struct inode *inode)
|
||||
if (mctime_update_needed(inode, &now)) {
|
||||
int err, release;
|
||||
struct ubifs_budget_req req = { .dirtied_ino = 1,
|
||||
.dirtied_ino_d = ui->data_len };
|
||||
.dirtied_ino_d = ALIGN(ui->data_len, 8) };
|
||||
|
||||
err = ubifs_budget_space(c, &req);
|
||||
if (err)
|
||||
|
Reference in New Issue
Block a user