Commit a1160143 authored by Marc Vef's avatar Marc Vef
Browse files

Merge branch 'rnou/215-unlink-gkfs_remove-can-delete-directories' into 'master'

Resolve "unlink (gkfs_remove) can delete directories"

Closes #215

See merge request !139
parents dbcf7f7f cebc72a9
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### New
### Changed
### Removed
### Fixed
- Using `unlink` now fails if it is a directory unless the `AT_REMOVEDIR` flag is used (POSIX compliance) ([!139](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/139)).

## [0.9.1] - 2022-04-29

+7 −0
Original line number Diff line number Diff line
@@ -276,6 +276,13 @@ gkfs_remove(const std::string& path) {
    if(!md) {
        return -1;
    }

    if(S_ISDIR(md->mode())) {
        LOG(ERROR, "Cannot remove directory '{}'", path);
        errno = EISDIR;
        return -1;
    }

    auto err = gkfs::rpc::forward_remove(path);
    if(err) {
        errno = err;
+1 −1
Original line number Diff line number Diff line
@@ -483,7 +483,7 @@ forward_get_dirents(const string& path) {
        }
    }

    LOG(INFO,
    LOG(DEBUG,
        "{}() path '{}' send rpc_srv_get_dirents() rpc to '{}' targets. per_host_buff_size '{}' Waiting on reply next and deserialize",
        __func__, path, targets.size(), per_host_buff_size);

+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ add_executable(gkfs.io
    gkfs.io/getcwd_validate.cpp
    gkfs.io/symlink.cpp
    gkfs.io/directory_validate.cpp
    gkfs.io/unlink.cpp
)

include(FetchContent)
+3 −0
Original line number Diff line number Diff line
@@ -108,4 +108,7 @@ getcwd_validate_init(CLI::App& app);
void
symlink_init(CLI::App& app);

void
unlink_init(CLI::App& app);

#endif // IO_COMMANDS_HPP
Loading