Skip to content
Snippets Groups Projects
Commit 713346ca authored by ZhaoLong Wang's avatar ZhaoLong Wang Committed by Richard Weinberger
Browse files

ubifs: Fix UBIFS ro fail due to truncate in the encrypted directory

The ubifs_compress() function does not compress the data When the
data length is short than 128 bytes or the compressed data length
is not ideal.It cause that the compressed length of the truncated
data in the truncate_data_node() function may be greater than the
length of the raw data read from the flash.

The above two lengths are transferred to the ubifs_encrypt()
function as parameters. This may lead to assertion fails and then
the file system becomes read-only.

This patch use the actual length of the data in the memory as the
input parameter for assert comparison, which avoids the problem.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=216213


Signed-off-by: default avatarZhaoLong Wang <wangzhaolong1@huawei.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 019ac05e
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment