[Git][reproducible-builds/disorderfs][debian] move from fuse to fuse3. Closes: #1084451
Holger Levsen (@holger)
gitlab at salsa.debian.org
Fri Jan 2 16:46:23 UTC 2026
Holger Levsen pushed to branch debian at Reproducible Builds / disorderfs
Commits:
e3378e5d by Roland Clobus at 2026-01-02T17:45:46+01:00
move from fuse to fuse3. Closes: #1084451
- - - - -
3 changed files:
- .gitlab-ci.yml
- Makefile
- disorderfs.cpp
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -8,7 +8,7 @@ stages:
script:
- apt-get -q update
- mount -o remount,rw /dev
- - apt-get -q -y install --no-install-recommends build-essential libfuse-dev pkg-config bc fuse3
+ - apt-get -q -y install --no-install-recommends build-essential libfuse3-dev pkg-config bc fuse3
- make test
except:
- debian
=====================================
Makefile
=====================================
@@ -30,12 +30,12 @@ HAS_A2X ?= $(shell command -v a2x >/dev/null && echo yes || echo no)
# FUSE
PKG_CONFIG ?= pkg-config
-FUSE_CFLAGS ?= $(shell $(PKG_CONFIG) --cflags fuse) -DFUSE_USE_VERSION=26
-FUSE_LIBS ?= $(shell $(PKG_CONFIG) --libs fuse) -lulockmgr
+FUSE_CFLAGS ?= $(shell $(PKG_CONFIG) --cflags fuse3) -DFUSE_USE_VERSION=31
+FUSE_LIBS ?= $(shell $(PKG_CONFIG) --libs fuse3)
# CXXFLAGS
CXXFLAGS += -Wall -Wextra -pedantic -O2 -g
-CXXFLAGS += -std=c++11 -Wno-unused-parameter
+CXXFLAGS += -std=c++20 -Wno-unused-parameter
CXXFLAGS += $(FUSE_CFLAGS)
# Files
=====================================
disorderfs.cpp
=====================================
@@ -24,9 +24,6 @@
#include <string>
#include <fstream>
#include <fuse.h>
-extern "C" {
-#include <ulockmgr.h>
-}
#include <dirent.h>
#include <iostream>
#include <memory>
@@ -227,7 +224,7 @@ int fuse_opt_proc (void* data, const char* arg, int key, struct fuse_args* outar
std::clog << " --reverse-dirents=yes|no reverse dirent order? (default: yes)" << std::endl;
std::clog << " --sort-dirents=yes|no sort directory entries deterministically instead (default: no)" << std::endl;
std::clog << " --pad-blocks=N add N to st_blocks (default: 1)" << std::endl;
- std::clog << " --share-locks=yes|no share locks with underlying filesystem (BUGGY; default: no)" << std::endl;
+ std::clog << " --share-locks=yes|no share locks with underlying filesystem (obsoleted, BUGGY; default: no)" << std::endl;
std::clog << std::endl;
fuse_opt_add_arg(outargs, "-ho");
fuse_main(outargs->argc, outargs->argv, &disorderfs_fuse_operations, nullptr);
@@ -272,7 +269,7 @@ int main (int argc, char** argv)
// Add some of our own hard-coded FUSE options:
fuse_opt_add_arg(&fargs, "-o");
- fuse_opt_add_arg(&fargs, "atomic_o_trunc,default_permissions,use_ino"); // XXX: other mount options?
+ fuse_opt_add_arg(&fargs, "default_permissions"); // XXX: other mount options?
if (config.multi_user) {
fuse_opt_add_arg(&fargs, "-o");
fuse_opt_add_arg(&fargs, "allow_other");
@@ -295,16 +292,16 @@ int main (int argc, char** argv)
* Initialize disorderfs_fuse_operations
*/
- /*
- * Indicate that we should accept UTIME_OMIT (and UTIME_NOW) in the
- * utimens operations for "touch -m" and "touch -a"
- */
- disorderfs_fuse_operations.flag_utime_omit_ok = 1;
-
- disorderfs_fuse_operations.getattr = [] (const char* path, struct stat* st) -> int {
+ disorderfs_fuse_operations.getattr = [] (const char* path, struct stat* st, struct fuse_file_info *info) -> int {
Guard g;
- if (lstat((root + path).c_str(), st) == -1) {
- return -errno;
+ if (info) {
+ if (fstat(info->fh, st) == -1) {
+ return -errno;
+ }
+ } else {
+ if (lstat((root + path).c_str(), st) == -1) {
+ return -errno;
+ }
}
st->st_blocks += config.pad_blocks;
return 0;
@@ -338,7 +335,8 @@ int main (int argc, char** argv)
Guard g;
return wrap(symlink(target, (root + linkpath).c_str()));
};
- disorderfs_fuse_operations.rename = [] (const char* oldpath, const char* newpath) -> int {
+ disorderfs_fuse_operations.rename = [] (const char* oldpath, const char* newpath, unsigned int flags) -> int {
+ // NEEDS TEST: flags may be RENAME_EXCHANGE and RENAME_NOREPLACE
Guard g;
return wrap(rename((root + oldpath).c_str(), (root + newpath).c_str()));
};
@@ -346,17 +344,21 @@ int main (int argc, char** argv)
Guard g;
return wrap(link((root + oldpath).c_str(), (root + newpath).c_str()));
};
- disorderfs_fuse_operations.chmod = [] (const char* path, mode_t mode) -> int {
+ disorderfs_fuse_operations.chmod = [] (const char* path, mode_t mode, struct fuse_file_info* info) -> int {
Guard g;
return wrap(chmod((root + path).c_str(), mode));
};
- disorderfs_fuse_operations.chown = [] (const char* path, uid_t uid, gid_t gid) -> int {
+ disorderfs_fuse_operations.chown = [] (const char* path, uid_t uid, gid_t gid, struct fuse_file_info* info) -> int {
Guard g;
return wrap(lchown((root + path).c_str(), uid, gid));
};
- disorderfs_fuse_operations.truncate = [] (const char* path, off_t length) -> int {
+ disorderfs_fuse_operations.truncate = [] (const char* path, off_t length, struct fuse_file_info* info) -> int {
Guard g;
- return wrap(truncate((root + path).c_str(), length));
+ if (info) {
+ return wrap(ftruncate(info->fh, length));
+ } else {
+ return wrap(truncate((root + path).c_str(), length));
+ }
};
disorderfs_fuse_operations.open = [] (const char* path, struct fuse_file_info* info) -> int {
Guard g;
@@ -455,7 +457,7 @@ int main (int argc, char** argv)
set_fuse_data<Dirents*>(info, dirents.release());
return 0;
};
- disorderfs_fuse_operations.readdir = [] (const char* path, void* buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info* info) {
+ disorderfs_fuse_operations.readdir = [] (const char* path, void* buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info* info, enum fuse_readdir_flags flags) {
Dirents& dirents = *get_fuse_data<Dirents*>(info);
struct stat st;
memset(&st, 0, sizeof(st));
@@ -465,9 +467,10 @@ int main (int argc, char** argv)
std::shuffle(dirents.begin(), dirents.end(), g);
}
+ enum fuse_fill_dir_flags fill_dir_flags = (flags == FUSE_READDIR_DEFAULTS ? FUSE_FILL_DIR_DEFAULTS : FUSE_FILL_DIR_PLUS);
for (const auto &dirent : dirents) {
st.st_ino = dirent.second;
- if (filler(buf, dirent.first.c_str(), &st, 0) != 0) {
+ if (filler(buf, dirent.first.c_str(), &st, 0, fill_dir_flags) != 0) {
return -ENOMEM;
}
}
@@ -492,25 +495,10 @@ int main (int argc, char** argv)
info->fh = fd;
return 0;
};
- disorderfs_fuse_operations.ftruncate = [] (const char* path, off_t off, struct fuse_file_info* info) -> int {
- return wrap(ftruncate(info->fh, off));
- };
- disorderfs_fuse_operations.fgetattr = [] (const char* path, struct stat* st, struct fuse_file_info* info) -> int {
- if (fstat(info->fh, st) == -1) {
- return -errno;
- }
- st->st_blocks += config.pad_blocks;
- return 0;
- };
if (config.share_locks) {
- disorderfs_fuse_operations.lock = [] (const char* path, struct fuse_file_info* info, int cmd, struct flock* lock) -> int {
- return ulockmgr_op(info->fh, cmd, lock, &info->lock_owner, sizeof(info->lock_owner));
- };
- disorderfs_fuse_operations.flock = [] (const char* path, struct fuse_file_info* info, int op) -> int {
- return wrap(flock(info->fh, op));
- };
+ perror_and_die("The share-locks feature is no longer provided in fuse3");
}
- disorderfs_fuse_operations.utimens = [] (const char* path, const struct timespec tv[2]) -> int {
+ disorderfs_fuse_operations.utimens = [] (const char* path, const struct timespec tv[2], struct fuse_file_info *info) -> int {
Guard g;
return wrap(utimensat(AT_FDCWD, (root + path).c_str(), tv, AT_SYMLINK_NOFOLLOW));
};
View it on GitLab: https://salsa.debian.org/reproducible-builds/disorderfs/-/commit/e3378e5d17e6cb49e356c87953d19b6211b4a17e
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/disorderfs/-/commit/e3378e5d17e6cb49e356c87953d19b6211b4a17e
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20260102/48fbc4a5/attachment.htm>
More information about the rb-commits
mailing list