diff options
author | Zoltan Sogor <weth@inf.u-szeged.hu> | 2008-08-12 06:54:54 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-08-13 04:43:56 -0400 |
commit | 5acd6ff8ac09eb71f3aef2ccccefab658be8aff4 (patch) | |
tree | 595344c0e6acf40b1febc0511d1f7fa5c85e7618 /fs/ubifs | |
parent | 840dc6b891d521f18bf081bd5a32e4a1f8110abc (diff) |
UBIFS: fix budgeting request alignment in xattr code
Data length has to be aligned in the budgeting request. Code
in xattr.c did not do this.
Signed-off-by: Zoltan Sogor <weth@inf.u-szeged.hu>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs')
-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 | ||