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 <[email protected]>

@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 <[email protected]>

jforissier and others added 4 commits February 2, 2018 10:23
Reported-by: Kevin Peng <[email protected]>
Signed-off-by: Jerome Forissier <[email protected]>
Reviewed-by: Jens Wiklander <[email protected]>
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 <[email protected]>
Reviewed-by: Jens Wiklander <[email protected]>
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 <[email protected]>
Reviewed-by: Jerome Forissier <[email protected]>
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 <[email protected]>
Reviewed-by: Jerome Forissier <[email protected]>
Fixes: OP-TEE#2094
Reported-by: Kevin Peng <[email protected]>
Tested-by: Kevin Peng <[email protected]>
[jf: add Fixes:, Reported-by: and Tested-by: tags]
Signed-off-by: Jerome Forissier <[email protected]>
@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