提交 59a74990 编写于 作者: D David Oberhollenzer 提交者: Richard Weinberger

ubifs: Fix data node size for truncating uncompressed nodes

Currently, the function truncate_data_node only updates the
destination data node size if compression is used. For
uncompressed nodes, the old length is incorrectly retained.

This patch makes sure that the length is correctly set when
compression is disabled.

Fixes: 7799953b ("ubifs: Implement encrypt/decrypt for all IO")
Signed-off-by: NDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Signed-off-by: NRichard Weinberger <richard@nod.at>
上级 f34e87f5
......@@ -1298,7 +1298,9 @@ static int truncate_data_node(const struct ubifs_info *c, const struct inode *in
goto out;
}
if (compr_type != UBIFS_COMPR_NONE) {
if (compr_type == UBIFS_COMPR_NONE) {
out_len = *new_len;
} else {
err = ubifs_decompress(c, &dn->data, dlen, buf, &out_len, compr_type);
if (err)
goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部