trapexit
3 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with
24 additions and
83 deletions
-
Makefile
-
buildtools/containerfiles/debian.9.amd64
-
buildtools/containerfiles/debian.9.arm64
-
buildtools/containerfiles/debian.9.armhf
-
buildtools/containerfiles/debian.9.i386
-
buildtools/containerfiles/ubuntu.18.04.amd64
-
buildtools/containerfiles/ubuntu.18.04.arm64
-
buildtools/containerfiles/ubuntu.18.04.armhf
-
buildtools/containerfiles/ubuntu.18.04.i386
-
libfuse/Makefile
-
libfuse/include/mutex_debug.hpp
-
libfuse/include/mutex_ndebug.hpp
-
libfuse/lib/debug.hpp
-
src/fs_wait_for_mount.cpp
-
src/fuse_statx_supported.icpp
-
src/policy_mspmfs.cpp
|
|
@ -40,7 +40,7 @@ UGID_USE_RWLOCK = 0 |
|
|
|
ifeq ($(NDEBUG),1) |
|
|
|
OPT_FLAGS := -O2 -DNDEBUG |
|
|
|
else |
|
|
|
OPT_FLAGS := -O0 -DDEBUG -g -fsanitize=undefined |
|
|
|
OPT_FLAGS := -O0 -DDEBUG -g |
|
|
|
endif |
|
|
|
|
|
|
|
ifeq ($(STATIC),1) |
|
|
@ -93,7 +93,8 @@ TESTS_FLAGS = \ |
|
|
|
LDFLAGS := \
|
|
|
|
${LDFLAGS} \
|
|
|
|
-pthread \
|
|
|
|
-lrt |
|
|
|
-lrt \
|
|
|
|
-lstdc++fs |
|
|
|
|
|
|
|
# https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
|
|
|
|
DESTDIR = |
|
|
|
|
|
@ -1,9 +0,0 @@ |
|
|
|
FROM --platform=linux/amd64 debian:9 as build |
|
|
|
COPY install-build-pkgs build-mergerfs /tmp/ |
|
|
|
RUN /tmp/install-build-pkgs |
|
|
|
ARG BUILD_TIMESTAMP=0 |
|
|
|
ARG BRANCH=master |
|
|
|
RUN /tmp/build-mergerfs $BRANCH |
|
|
|
|
|
|
|
FROM scratch |
|
|
|
COPY --from=build /build/ / |
|
|
@ -1,9 +0,0 @@ |
|
|
|
FROM --platform=linux/arm64 debian:9 as build |
|
|
|
COPY install-build-pkgs build-mergerfs /tmp/ |
|
|
|
RUN /tmp/install-build-pkgs |
|
|
|
ARG BUILD_TIMESTAMP=0 |
|
|
|
ARG BRANCH=master |
|
|
|
RUN /tmp/build-mergerfs $BRANCH |
|
|
|
|
|
|
|
FROM scratch |
|
|
|
COPY --from=build /build/ / |
|
|
@ -1,9 +0,0 @@ |
|
|
|
FROM --platform=linux/armhf debian:9 as build |
|
|
|
COPY install-build-pkgs build-mergerfs /tmp/ |
|
|
|
RUN /tmp/install-build-pkgs |
|
|
|
ARG BUILD_TIMESTAMP=0 |
|
|
|
ARG BRANCH=master |
|
|
|
RUN /tmp/build-mergerfs $BRANCH |
|
|
|
|
|
|
|
FROM scratch |
|
|
|
COPY --from=build /build/ / |
|
|
@ -1,9 +0,0 @@ |
|
|
|
FROM --platform=linux/i386 debian:9 as build |
|
|
|
COPY install-build-pkgs build-mergerfs /tmp/ |
|
|
|
RUN /tmp/install-build-pkgs |
|
|
|
ARG BUILD_TIMESTAMP=0 |
|
|
|
ARG BRANCH=master |
|
|
|
RUN /tmp/build-mergerfs $BRANCH |
|
|
|
|
|
|
|
FROM scratch |
|
|
|
COPY --from=build /build/ / |
|
|
@ -1,9 +0,0 @@ |
|
|
|
FROM --platform=linux/amd64 ubuntu:18.04 as build |
|
|
|
COPY install-build-pkgs build-mergerfs /tmp/ |
|
|
|
RUN /tmp/install-build-pkgs |
|
|
|
ARG BUILD_TIMESTAMP=0 |
|
|
|
ARG BRANCH=master |
|
|
|
RUN /tmp/build-mergerfs $BRANCH |
|
|
|
|
|
|
|
FROM scratch |
|
|
|
COPY --from=build /build/ / |
|
|
@ -1,9 +0,0 @@ |
|
|
|
FROM --platform=linux/arm64 ubuntu:18.04 as build |
|
|
|
COPY install-build-pkgs build-mergerfs /tmp/ |
|
|
|
RUN /tmp/install-build-pkgs |
|
|
|
ARG BUILD_TIMESTAMP=0 |
|
|
|
ARG BRANCH=master |
|
|
|
RUN /tmp/build-mergerfs $BRANCH |
|
|
|
|
|
|
|
FROM scratch |
|
|
|
COPY --from=build /build/ / |
|
|
@ -1,9 +0,0 @@ |
|
|
|
FROM --platform=linux/armhf ubuntu:18.04 as build |
|
|
|
COPY install-build-pkgs build-mergerfs /tmp/ |
|
|
|
RUN /tmp/install-build-pkgs |
|
|
|
ARG BUILD_TIMESTAMP=0 |
|
|
|
ARG BRANCH=master |
|
|
|
RUN /tmp/build-mergerfs $BRANCH |
|
|
|
|
|
|
|
FROM scratch |
|
|
|
COPY --from=build /build/ / |
|
|
@ -1,9 +0,0 @@ |
|
|
|
FROM --platform=linux/i386 ubuntu:18.04 as build |
|
|
|
COPY install-build-pkgs build-mergerfs /tmp/ |
|
|
|
RUN /tmp/install-build-pkgs |
|
|
|
ARG BUILD_TIMESTAMP=0 |
|
|
|
ARG BRANCH=master |
|
|
|
RUN /tmp/build-mergerfs $BRANCH |
|
|
|
|
|
|
|
FROM scratch |
|
|
|
COPY --from=build /build/ / |
|
|
@ -12,7 +12,7 @@ endif |
|
|
|
ifeq ($(NDEBUG),1) |
|
|
|
OPT_FLAGS := -O2 -DNDEBUG |
|
|
|
else |
|
|
|
OPT_FLAGS := -O0 -DDEBUG -g -fsanitize=undefined |
|
|
|
OPT_FLAGS := -O0 -DDEBUG -g |
|
|
|
endif |
|
|
|
|
|
|
|
ifeq ($(LTO),1) |
|
|
|
|
|
@ -7,6 +7,10 @@ |
|
|
|
#include <pthread.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
#ifndef PTHREAD_MUTEX_ADAPTIVE_NP
|
|
|
|
# define PTHREAD_MUTEX_ADAPTIVE_NP PTHREAD_MUTEX_NORMAL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define mutex_init(M) _mutex_init(M,__FILE__,__func__,__LINE__)
|
|
|
|
#define mutex_destroy(M) _mutex_destroy(M,__FILE__,__func__,__LINE__)
|
|
|
|
#define mutex_lock(M) _mutex_lock(M,__FILE__,__func__,__LINE__)
|
|
|
@ -97,7 +101,7 @@ _mutex_lock(pthread_mutex_t *mutex_, |
|
|
|
case 0: |
|
|
|
return; |
|
|
|
case ETIMEDOUT: |
|
|
|
cnt++; |
|
|
|
cnt++; |
|
|
|
fmt::println(stderr, |
|
|
|
"NOTICE: pthread_mutex_timedlock expired - count={}; ({}:{}:{})", |
|
|
|
cnt, |
|
|
|
|
|
@ -4,6 +4,10 @@ |
|
|
|
|
|
|
|
#include <pthread.h>
|
|
|
|
|
|
|
|
#ifndef PTHREAD_MUTEX_ADAPTIVE_NP
|
|
|
|
# define PTHREAD_MUTEX_ADAPTIVE_NP PTHREAD_MUTEX_NORMAL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
static |
|
|
|
inline |
|
|
|
|
|
@ -18,6 +18,8 @@ |
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "fuse_kernel.h"
|
|
|
|
|
|
|
|
void debug_fuse_open_out(const uint64_t unique, |
|
|
@ -51,5 +53,6 @@ void debug_fuse_bmap_out(const uint64_t unique, |
|
|
|
void debug_fuse_in_header(const struct fuse_in_header *hdr); |
|
|
|
|
|
|
|
std::string fuse_debug_init_flag_name(const uint64_t); |
|
|
|
|
|
|
|
void fuse_syslog_fuse_init_in(const struct fuse_init_in *arg); |
|
|
|
void fuse_syslog_fuse_init_out(const struct fuse_init_out *arg); |
|
|
@ -26,12 +26,12 @@ |
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
#include <thread>
|
|
|
|
#include <unordered_set>
|
|
|
|
#include <set>
|
|
|
|
|
|
|
|
|
|
|
|
namespace fs |
|
|
|
{ |
|
|
|
typedef std::unordered_set<fs::Path> PathSet; |
|
|
|
typedef std::set<fs::Path> PathSet; |
|
|
|
} |
|
|
|
|
|
|
|
constexpr std::chrono::milliseconds SLEEP_DURATION = std::chrono::milliseconds(333); |
|
|
@ -99,9 +99,9 @@ _wait_for_mount(const struct stat &src_st_, |
|
|
|
const std::chrono::milliseconds &timeout_) |
|
|
|
{ |
|
|
|
bool first_loop; |
|
|
|
fs::PathVector successes; |
|
|
|
fs::PathVector failures; |
|
|
|
std::unordered_set<fs::Path> tgt_paths; |
|
|
|
fs::PathVector successes; |
|
|
|
fs::PathVector failures; |
|
|
|
fs::PathSet tgt_paths; |
|
|
|
std::chrono::time_point<std::chrono::steady_clock> now; |
|
|
|
std::chrono::time_point<std::chrono::steady_clock> deadline; |
|
|
|
|
|
|
|
|
|
@ -24,7 +24,7 @@ _set_stat_if_leads_to_dir(const std::string &path_, |
|
|
|
int rv; |
|
|
|
struct fuse_statx st; |
|
|
|
|
|
|
|
rv = fs::statx(AT_FDCWD,path_,AT_SYMLINK_FOLLOW,STATX_TYPE,st_); |
|
|
|
rv = fs::statx(AT_FDCWD,path_,AT_SYMLINK_FOLLOW,STATX_TYPE,&st); |
|
|
|
if(rv < 0) |
|
|
|
return; |
|
|
|
|
|
|
@ -42,7 +42,7 @@ _set_stat_if_leads_to_reg(const std::string &path_, |
|
|
|
int rv; |
|
|
|
struct fuse_statx st; |
|
|
|
|
|
|
|
rv = fs::statx(AT_FDCWD,path_,AT_SYMLINK_FOLLOW,STATX_TYPE,st_); |
|
|
|
rv = fs::statx(AT_FDCWD,path_,AT_SYMLINK_FOLLOW,STATX_TYPE,&st); |
|
|
|
if(rv < 0) |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
@ -42,6 +42,7 @@ namespace mspmfs |
|
|
|
fs::info_t info; |
|
|
|
Branch *obranch; |
|
|
|
|
|
|
|
obranch = nullptr; |
|
|
|
mfs = std::numeric_limits<uint64_t>::min(); |
|
|
|
for(auto &branch : *branches_) |
|
|
|
{ |
|
|
|