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

DAOS-16556 client: call fstat() before mmap() to update file status in kernel #15244

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/client/dfuse/pil4dfs/int_dfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -6302,6 +6302,14 @@ new_mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)

atomic_fetch_add_relaxed(&num_mmap, 1);

if ((fd < FD_FILE_BASE) && (fd_directed >= FD_FILE_BASE) && d_compatible_mode) {
/* DAOS-14494: Force the kernel to update the size before mapping. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've linked DAOS-14494 and DAOS-16556 in Jira.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Thank you very much!

rc = next_fxstat(1, fd, &stat_buf);
if (rc == -1)
return MAP_FAILED;
return next_mmap(addr, length, prot, flags, fd, offset);
}

addr_ret = next_mmap(addr, length, prot, flags | MAP_ANONYMOUS, -1, offset);
if (addr_ret == MAP_FAILED)
return MAP_FAILED;
Expand Down Expand Up @@ -7086,10 +7094,8 @@ init_myhook(void)

register_a_hook("libc", "fcntl", (void *)new_fcntl, (long int *)(&libc_fcntl));

if (d_compatible_mode == false) {
register_a_hook("libc", "mmap", (void *)new_mmap, (long int *)(&next_mmap));
register_a_hook("libc", "munmap", (void *)new_munmap, (long int *)(&next_munmap));
}
register_a_hook("libc", "mmap", (void *)new_mmap, (long int *)(&next_mmap));
register_a_hook("libc", "munmap", (void *)new_munmap, (long int *)(&next_munmap));

register_a_hook("libc", "exit", (void *)new_exit, (long int *)(&next_exit));
register_a_hook("libc", "dup3", (void *)new_dup3, (long int *)(&libc_dup3));
Expand Down
Loading