Commit 3c0dc598 authored by Ramon Nou's avatar Ramon Nou
Browse files

Add log for close internal, INT_MAX const and changelog

parent 3ffbe47d
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -7,10 +7,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### New
### Changed
- Unify dependency scripts (dl and compile): Unify `-d` and `-p` flags ([!174](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/174)).
- Support for `close_range` syscall. ([!201](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/201)).
  - Removal of `O_PATH` check in `gkfs_open`, allows cp with asterisk. This is for newer kernels.
  - Support to print newer syscall (although not implemented). Added syscall number to log for easy capture missing ones.
### Changed
- Unify dependency scripts (dl and compile): Unify `-d` and `-p` flags ([!174](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/174)).
- Increased merge assert for files with size 0, specific for DLIO with GekkoFS in Debug ([!208])(https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/208)).
### Removed
+2 −1
Original line number Diff line number Diff line
@@ -1637,8 +1637,9 @@ gkfs_close(unsigned int fd) {
    if(CTX->is_internal_fd(fd)) {
        // the client application (for some reason) is trying to close an
        // internal fd: ignore it
        LOG(ERROR, "{}() closing an internal fd '{}'", __func__, fd);
        errno = EACCES;
        return -1;
        // Maybe we should return -1?
    }

    return -1;
+7 −8
Original line number Diff line number Diff line
@@ -415,20 +415,18 @@ hook_internal(long syscall_number, long arg0, long arg1, long arg2, long arg3,
                    static_cast<int>(arg1), static_cast<int>(arg2));
            if(*result >= 0) {
                for(auto i = arg0; i < arg1; i++) {
                    if(arg1 == 2147483647) {
                        if(i >= GKFS_MAX_INTERNAL_FDS)
                    if(arg1 == INT_MAX or i >= GKFS_MAX_INTERNAL_FDS) {
                        break;
                    }

                    CTX->unregister_internal_fd(i);
                }
            }
            break;
#endif
        default:
            // ignore any other syscalls, i.e.: pass them on to the kernel
            // (syscalls forwarded to the kernel that return are logged in
            // hook_forwarded_syscall())
            // ignore any other syscalls, i.e.: pass them on to the
            // kernel (syscalls forwarded to the kernel that return are
            // logged in hook_forwarded_syscall())
            ::save_current_syscall_info(gkfs::syscall::from_internal_code |
                                        gkfs::syscall::to_kernel |
                                        gkfs::syscall::not_executed);
@@ -446,7 +444,8 @@ hook_internal(long syscall_number, long arg0, long arg1, long arg2, long arg3,
/*
 * hook -- interception hook for application syscalls
 *
 * This hook is used to implement any application filesystem-related syscalls.
 * This hook is used to implement any application filesystem-related
 * syscalls.
 */
inline int
hook(long syscall_number, long arg0, long arg1, long arg2, long arg3, long arg4,