Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ree_fs_truncate() sync #2099

Merged
merged 4 commits into from
Feb 2, 2018
Merged

ree_fs_truncate() sync #2099

merged 4 commits into from
Feb 2, 2018

Conversation

jforissier
Copy link
Contributor

No description provided.

@jenswi-linaro
Copy link
Contributor

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

@jforissier
Copy link
Contributor Author

Needs more investigation, it seems that the new size (new meta-data) is indeed written to disk but for some reason when the object is re-open, the wrong header index is used and the previous header is read (hence the older size is assumed).

@jenswi-linaro
Copy link
Contributor

Please add jenswi-linaro@430eaf3

It fixes one error. I'm working on the remaining error.

@jenswi-linaro
Copy link
Contributor

Please add jenswi-linaro@70ae450

It fixes the remaining error.

@jforissier
Copy link
Contributor Author

Thanks @jenswi-linaro, works fine now.

@kevin-peng-hao
Copy link

kevin-peng-hao commented Feb 2, 2018

Thanks @jforissier @jenswi-linaro . The issue should have been fixed.

Tested-by: Kevin Peng <kevinp@marvell.com>

jforissier and others added 4 commits February 2, 2018 10:23
Reported-by: Kevin Peng <kevinp@marvell.com>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
When an object is truncated but the number of blocks is unchanged, only
the metadata's length field is modified. The hash tree layer has to be
notified so that it knows it has to flush the data before closing the
object, otherwise the truncation is lost.
Add a function for that purpose: tee_fs_htree_meta_set_dirty(), and
call it whenever meta->length is updated.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
To commit the changes done by ree_fs_truncate() in the dirfile, call
commit_dirh_writes() before closing the dirh.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Includes the meta data when calculating the hash of the root node to
detect changes in file length while number of blocks is unchanged.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Fixes: OP-TEE#2094
Reported-by: Kevin Peng <kevinp@marvell.com>
Tested-by: Kevin Peng <kevinp@marvell.com>
[jf: add Fixes:, Reported-by: and Tested-by: tags]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
@jforissier jforissier merged commit 94a7299 into OP-TEE:master Feb 2, 2018
@jforissier jforissier deleted the truncate-sync branch February 2, 2018 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants