Skip to content

Commit

Permalink
fixup! [LibOS] Make handling of corruption more consistent (WIP)
Browse files Browse the repository at this point in the history
Signed-off-by: g2flyer <[email protected]>
  • Loading branch information
g2flyer committed Aug 27, 2024
1 parent 62543cd commit 977e999
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libos/src/fs/libos_fs_encrypted.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,14 @@ static int encrypted_file_internal_open(struct libos_encrypted_file* enc, PAL_HA
norm_path = NULL; /* to prevent freeing it */
HASH_ADD_KEYPTR(hh, enc->volume->files_state_map, file_state->norm_path,
strlen(file_state->norm_path), file_state);
log_debug(
"updated file protection map with file '%s', state '%s' and MAC=" MAC_PRINTF_PATTERN,
file_state->norm_path, file_state_to_string(file_state->state),
MAC_PRINTF_ARGS(file_state->last_seen_root_mac));
}
/* we do below unconditionally as we might recreate a deleted file or overwrite an existing
* one */
memcpy(file_state->last_seen_root_mac, opening_root_mac, sizeof(pf_mac_t));
file_state->state = new_state_in_map;
log_debug("updated file protection map with file '%s', state '%s' and MAC=" MAC_PRINTF_PATTERN,
file_state->norm_path, file_state_to_string(file_state->state),
MAC_PRINTF_ARGS(file_state->last_seen_root_mac));

if (ret == 0) {
enc->pf = pf;
Expand Down

0 comments on commit 977e999

Please sign in to comment.