diff options
Diffstat (limited to 'fs/ubifs/xattr.c')
-rw-r--r-- | fs/ubifs/xattr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index 39e831d074ce..6f493dea561e 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c | |||
@@ -103,8 +103,8 @@ static int create_xattr(struct ubifs_info *c, struct inode *host, | |||
103 | struct inode *inode; | 103 | struct inode *inode; |
104 | struct ubifs_inode *ui, *host_ui = ubifs_inode(host); | 104 | struct ubifs_inode *ui, *host_ui = ubifs_inode(host); |
105 | struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1, | 105 | struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1, |
106 | .new_ino_d = size, .dirtied_ino = 1, | 106 | .new_ino_d = ALIGN(size, 8), .dirtied_ino = 1, |
107 | .dirtied_ino_d = ALIGN(host_ui->data_len, 8)}; | 107 | .dirtied_ino_d = ALIGN(host_ui->data_len, 8) }; |
108 | 108 | ||
109 | if (host_ui->xattr_cnt >= MAX_XATTRS_PER_INODE) | 109 | if (host_ui->xattr_cnt >= MAX_XATTRS_PER_INODE) |
110 | return -ENOSPC; | 110 | return -ENOSPC; |
@@ -200,7 +200,7 @@ static int change_xattr(struct ubifs_info *c, struct inode *host, | |||
200 | struct ubifs_inode *host_ui = ubifs_inode(host); | 200 | struct ubifs_inode *host_ui = ubifs_inode(host); |
201 | struct ubifs_inode *ui = ubifs_inode(inode); | 201 | struct ubifs_inode *ui = ubifs_inode(inode); |
202 | struct ubifs_budget_req req = { .dirtied_ino = 2, | 202 | struct ubifs_budget_req req = { .dirtied_ino = 2, |
203 | .dirtied_ino_d = size + host_ui->data_len }; | 203 | .dirtied_ino_d = ALIGN(size, 8) + ALIGN(host_ui->data_len, 8) }; |
204 | 204 | ||
205 | ubifs_assert(ui->data_len == inode->i_size); | 205 | ubifs_assert(ui->data_len == inode->i_size); |
206 | err = ubifs_budget_space(c, &req); | 206 | err = ubifs_budget_space(c, &req); |
@@ -497,8 +497,8 @@ static int remove_xattr(struct ubifs_info *c, struct inode *host, | |||
497 | int err; | 497 | int err; |
498 | struct ubifs_inode *host_ui = ubifs_inode(host); | 498 | struct ubifs_inode *host_ui = ubifs_inode(host); |
499 | struct ubifs_inode *ui = ubifs_inode(inode); | 499 | struct ubifs_inode *ui = ubifs_inode(inode); |
500 | struct ubifs_budget_req req = { .dirtied_ino = 1, .mod_dent = 1, | 500 | struct ubifs_budget_req req = { .dirtied_ino = 2, .mod_dent = 1, |
501 | .dirtied_ino_d = host_ui->data_len }; | 501 | .dirtied_ino_d = ALIGN(host_ui->data_len, 8) }; |
502 | 502 | ||
503 | ubifs_assert(ui->data_len == inode->i_size); | 503 | ubifs_assert(ui->data_len == inode->i_size); |
504 | 504 | ||