-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ree_fs_truncate() sync #2099
Conversation
|
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). |
Please add jenswi-linaro@430eaf3 It fixes one error. I'm working on the remaining error. |
Please add jenswi-linaro@70ae450 It fixes the remaining error. |
3996b4e
to
b4fffaf
Compare
Thanks @jenswi-linaro, works fine now. |
Thanks @jforissier @jenswi-linaro . The issue should have been fixed.
|
b4fffaf
to
0536c00
Compare
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]>
0536c00
to
d4fd366
Compare
No description provided.