Compare commits
No commits in common. "c8" and "c9s" have entirely different histories.
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
@ -1,2 +0,0 @@
|
||||
fcb3641d5297938f4e183296eccaf0ccc1a0f892 SOURCES/fuse-2.9.7.tar.gz
|
||||
413a2dcb4d274483893166c7894e1920ee61ab53 SOURCES/fuse-3.3.0.tar.gz
|
12
.gitignore
vendored
12
.gitignore
vendored
@ -1,2 +1,10 @@
|
||||
SOURCES/fuse-2.9.7.tar.gz
|
||||
SOURCES/fuse-3.3.0.tar.gz
|
||||
fuse-2.8.4.tar.gz
|
||||
/fuse-2.8.5.tar.gz
|
||||
/fuse-2.8.6.tar.gz
|
||||
/fuse-2.8.7.tar.gz
|
||||
/fuse-2.9.1.tar.gz
|
||||
/fuse-2.9.2.tar.gz
|
||||
/fuse-2.9.3.tar.gz
|
||||
/fuse-2.9.4.tar.gz
|
||||
/fuse-2.9.7.tar.gz
|
||||
/fuse-2.9.9.tar.gz
|
||||
|
@ -1,59 +0,0 @@
|
||||
From 492d3a24c13babd103fb71d44adfb8e94687db52 Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Reichl <preichl@redhat.com>
|
||||
Date: Tue, 7 Jun 2022 08:27:36 +0200
|
||||
Subject: [PATCH 1/4] Synchronize fuse_kernel.h
|
||||
|
||||
Signed-off-by: Pavel Reichl <preichl@redhat.com>
|
||||
---
|
||||
include/fuse_kernel.h | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h
|
||||
index 42fa977..b55fa8b 100644
|
||||
--- a/include/fuse_kernel.h
|
||||
+++ b/include/fuse_kernel.h
|
||||
@@ -215,10 +215,12 @@ struct fuse_file_lock {
|
||||
* FOPEN_DIRECT_IO: bypass page cache for this open file
|
||||
* FOPEN_KEEP_CACHE: don't invalidate the data cache on open
|
||||
* FOPEN_NONSEEKABLE: the file is not seekable
|
||||
+ * FOPEN_CACHE_DIR: allow caching this directory
|
||||
*/
|
||||
#define FOPEN_DIRECT_IO (1 << 0)
|
||||
#define FOPEN_KEEP_CACHE (1 << 1)
|
||||
#define FOPEN_NONSEEKABLE (1 << 2)
|
||||
+#define FOPEN_CACHE_DIR (1 << 3)
|
||||
|
||||
/**
|
||||
* INIT request/reply flags
|
||||
@@ -244,6 +246,8 @@ struct fuse_file_lock {
|
||||
* FUSE_PARALLEL_DIROPS: allow parallel lookups and readdir
|
||||
* FUSE_HANDLE_KILLPRIV: fs handles killing suid/sgid/cap on write/chown/trunc
|
||||
* FUSE_POSIX_ACL: filesystem supports posix acls
|
||||
+ * FUSE_MAX_PAGES: init_out.max_pages contains the max number of req pages
|
||||
+ * FUSE_CACHE_SYMLINKS: cache READLINK responses
|
||||
*/
|
||||
#define FUSE_ASYNC_READ (1 << 0)
|
||||
#define FUSE_POSIX_LOCKS (1 << 1)
|
||||
@@ -266,6 +270,8 @@ struct fuse_file_lock {
|
||||
#define FUSE_PARALLEL_DIROPS (1 << 18)
|
||||
#define FUSE_HANDLE_KILLPRIV (1 << 19)
|
||||
#define FUSE_POSIX_ACL (1 << 20)
|
||||
+#define FUSE_MAX_PAGES (1 << 22)
|
||||
+#define FUSE_CACHE_SYMLINKS (1 << 23)
|
||||
|
||||
/**
|
||||
* CUSE INIT request/reply flags
|
||||
@@ -604,7 +610,9 @@ struct fuse_init_out {
|
||||
uint16_t congestion_threshold;
|
||||
uint32_t max_write;
|
||||
uint32_t time_gran;
|
||||
- uint32_t unused[9];
|
||||
+ uint16_t max_pages;
|
||||
+ uint16_t padding;
|
||||
+ uint32_t unused[8];
|
||||
};
|
||||
|
||||
#define CUSE_INIT_INFO_MAX 4096
|
||||
--
|
||||
2.36.1
|
||||
|
@ -1,130 +0,0 @@
|
||||
From 5100bdc814435a1222fef6438cebcd81a3de6c73 Mon Sep 17 00:00:00 2001
|
||||
From: scosu <mpargmann@allfex.org>
|
||||
Date: Thu, 13 Jun 2019 13:59:10 +0200
|
||||
Subject: [PATCH 2/4] fuse_lowlevel: Add max_pages support (#384)
|
||||
|
||||
Starting with kernel version 4.20 fuse supports a new property
|
||||
'max_pages' which is the maximum number of pages that can be used per
|
||||
request. This can be set via an argument during initialization.
|
||||
This new property allows writes to be larger than 128k.
|
||||
|
||||
This patch sets the property if the matching capability is set
|
||||
(FUSE_MAX_PAGES). It will also set max_write to 1MiB. Filesystems have
|
||||
the possibility to decrease this size by setting max_write to a smaller
|
||||
size. The max_pages and bufsize fields are adjusted accordingly.
|
||||
|
||||
Cc: Constantine Shulyupin <const@MakeLinux.com>
|
||||
Signed-off-by: Markus Pargmann <scosu@quobyte.com>
|
||||
(cherry picked from commit 027d0d17c8a4605109f09d9c988e255b64a2c19a)
|
||||
Signed-off-by: Pavel Reichl <preichl@redhat.com>
|
||||
---
|
||||
ChangeLog.rst | 7 +++++++
|
||||
lib/fuse_i.h | 6 ++++++
|
||||
lib/fuse_lowlevel.c | 30 +++++++++++++++++++++---------
|
||||
3 files changed, 34 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/ChangeLog.rst b/ChangeLog.rst
|
||||
index 8ea9397..411cd4a 100644
|
||||
--- a/ChangeLog.rst
|
||||
+++ b/ChangeLog.rst
|
||||
@@ -1,6 +1,13 @@
|
||||
libfuse 3.3.0 (2018-11-06)
|
||||
==========================
|
||||
|
||||
+* Added support for fuse kernel feature `max_pages` which allows to increase
|
||||
+ the maximum number of pages that can be used per request. This feature was
|
||||
+ introduced in kernel 4.20. `max_pages` is set based on the value in
|
||||
+ `max_write`. By default `max_write` will be 1MiB now for kernels that support
|
||||
+ `max_pages`. If you want smaller buffers or writes you have to set
|
||||
+ `max_write` manually.
|
||||
+
|
||||
* The `auto_unmount` mode now works correctly in combination with
|
||||
autofs.
|
||||
|
||||
diff --git a/lib/fuse_i.h b/lib/fuse_i.h
|
||||
index cf35551..d38b630 100644
|
||||
--- a/lib/fuse_i.h
|
||||
+++ b/lib/fuse_i.h
|
||||
@@ -131,3 +131,9 @@ struct fuse *fuse_new_31(struct fuse_args *args, const struct fuse_operations *o
|
||||
int fuse_loop_mt_32(struct fuse *f, struct fuse_loop_config *config);
|
||||
int fuse_session_loop_mt_32(struct fuse_session *se, struct fuse_loop_config *config);
|
||||
|
||||
+#define FUSE_MAX_MAX_PAGES 256
|
||||
+#define FUSE_DEFAULT_MAX_PAGES_PER_REQ 32
|
||||
+
|
||||
+/* room needed in buffer to accommodate header */
|
||||
+#define FUSE_BUFFER_HEADER_SIZE 0x1000
|
||||
+
|
||||
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
|
||||
index 844e797..60195e0 100644
|
||||
--- a/lib/fuse_lowlevel.c
|
||||
+++ b/lib/fuse_lowlevel.c
|
||||
@@ -1882,6 +1882,14 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
|
||||
se->conn.capable |= FUSE_CAP_POSIX_ACL;
|
||||
if (arg->flags & FUSE_HANDLE_KILLPRIV)
|
||||
se->conn.capable |= FUSE_CAP_HANDLE_KILLPRIV;
|
||||
+ if (!(arg->flags & FUSE_MAX_PAGES)) {
|
||||
+ size_t max_bufsize =
|
||||
+ FUSE_DEFAULT_MAX_PAGES_PER_REQ * getpagesize()
|
||||
+ + FUSE_BUFFER_HEADER_SIZE;
|
||||
+ if (bufsize > max_bufsize) {
|
||||
+ bufsize = max_bufsize;
|
||||
+ }
|
||||
+ }
|
||||
} else {
|
||||
se->conn.max_readahead = 0;
|
||||
}
|
||||
@@ -1928,10 +1936,10 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
|
||||
bufsize);
|
||||
bufsize = FUSE_MIN_READ_BUFFER;
|
||||
}
|
||||
+ se->bufsize = bufsize;
|
||||
|
||||
- bufsize -= 4096;
|
||||
- if (bufsize < se->conn.max_write)
|
||||
- se->conn.max_write = bufsize;
|
||||
+ if (se->conn.max_write > bufsize - FUSE_BUFFER_HEADER_SIZE)
|
||||
+ se->conn.max_write = bufsize - FUSE_BUFFER_HEADER_SIZE;
|
||||
|
||||
se->got_init = 1;
|
||||
if (se->op.init)
|
||||
@@ -1958,6 +1966,14 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (se->conn.max_write < bufsize - FUSE_BUFFER_HEADER_SIZE) {
|
||||
+ se->bufsize = se->conn.max_write + FUSE_BUFFER_HEADER_SIZE;
|
||||
+ }
|
||||
+ if (arg->flags & FUSE_MAX_PAGES) {
|
||||
+ outarg.flags |= FUSE_MAX_PAGES;
|
||||
+ outarg.max_pages = (se->conn.max_write - 1) / getpagesize() + 1;
|
||||
+ }
|
||||
+
|
||||
/* Always enable big writes, this is superseded
|
||||
by the max_write option */
|
||||
outarg.flags |= FUSE_BIG_WRITES;
|
||||
@@ -2779,11 +2795,6 @@ restart:
|
||||
return res;
|
||||
}
|
||||
|
||||
-#define KERNEL_BUF_PAGES 32
|
||||
-
|
||||
-/* room needed in buffer to accommodate header */
|
||||
-#define HEADER_SIZE 0x1000
|
||||
-
|
||||
struct fuse_session *fuse_session_new(struct fuse_args *args,
|
||||
const struct fuse_lowlevel_ops *op,
|
||||
size_t op_size, void *userdata)
|
||||
@@ -2844,7 +2855,8 @@ struct fuse_session *fuse_session_new(struct fuse_args *args,
|
||||
if (se->debug)
|
||||
fprintf(stderr, "FUSE library version: %s\n", PACKAGE_VERSION);
|
||||
|
||||
- se->bufsize = KERNEL_BUF_PAGES * getpagesize() + HEADER_SIZE;
|
||||
+ se->bufsize = FUSE_MAX_MAX_PAGES * getpagesize() +
|
||||
+ FUSE_BUFFER_HEADER_SIZE;
|
||||
|
||||
list_init_req(&se->list);
|
||||
list_init_req(&se->interrupts);
|
||||
--
|
||||
2.36.1
|
||||
|
@ -1,83 +0,0 @@
|
||||
From be7f19b21c84004c5a0705f040b957fd1c609e2e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Etienne=20Dubl=C3=A9?= <etienne.duble@imag.fr>
|
||||
Date: Sun, 20 Sep 2020 20:08:15 +0200
|
||||
Subject: [PATCH 3/4] Allow caching symlinks in kernel page cache. (#551)
|
||||
|
||||
This commit defines a new capability called `FUSE_CAP_CACHE_SYMLINKS`.
|
||||
It is off by default but you can now enable it by setting this flag in
|
||||
in the `want` field of the `fuse_conn_info` structure.
|
||||
|
||||
When enabled, the kernel will save symlinks in its page cache,
|
||||
by making use of the feature introduced in kernel 4.20:
|
||||
https://github.com/torvalds/linux/commit/5571f1e65486be025f73fa6aa30fb03725d362a2
|
||||
|
||||
(cherry picked from commit ba3b225a126ebb3c6d4fe27c9f7c73aa4167001e)
|
||||
Signed-off-by: Pavel Reichl <preichl@redhat.com>
|
||||
---
|
||||
example/printcap.c | 2 ++
|
||||
include/fuse_common.h | 13 +++++++++++++
|
||||
lib/fuse_lowlevel.c | 4 ++++
|
||||
3 files changed, 19 insertions(+)
|
||||
|
||||
diff --git a/example/printcap.c b/example/printcap.c
|
||||
index 77dea14..a66036f 100644
|
||||
--- a/example/printcap.c
|
||||
+++ b/example/printcap.c
|
||||
@@ -77,6 +77,8 @@ static void pc_init(void *userdata,
|
||||
printf("\tFUSE_CAP_PARALLEL_DIROPS\n");
|
||||
if(conn->capable & FUSE_CAP_POSIX_ACL)
|
||||
printf("\tFUSE_CAP_POSIX_ACL\n");
|
||||
+ if(conn->capable & FUSE_CAP_CACHE_SYMLINKS)
|
||||
+ printf("\tFUSE_CAP_CACHE_SYMLINKS\n");
|
||||
fuse_session_exit(se);
|
||||
}
|
||||
|
||||
diff --git a/include/fuse_common.h b/include/fuse_common.h
|
||||
index 83c9dee..a5a0ea5 100644
|
||||
--- a/include/fuse_common.h
|
||||
+++ b/include/fuse_common.h
|
||||
@@ -316,6 +316,19 @@ struct fuse_loop_config {
|
||||
*/
|
||||
#define FUSE_CAP_HANDLE_KILLPRIV (1 << 20)
|
||||
|
||||
+/**
|
||||
+ * Indicates that the kernel supports caching symlinks in its page cache.
|
||||
+ *
|
||||
+ * When this feature is enabled, symlink targets are saved in the page cache.
|
||||
+ * You can invalidate a cached link by calling:
|
||||
+ * `fuse_lowlevel_notify_inval_inode(se, ino, 0, 0);`
|
||||
+ *
|
||||
+ * This feature is disabled by default.
|
||||
+ * If the kernel supports it (>= 4.20), you can enable this feature by
|
||||
+ * setting this flag in the `want` field of the `fuse_conn_info` structure.
|
||||
+ */
|
||||
+#define FUSE_CAP_CACHE_SYMLINKS (1 << 23)
|
||||
+
|
||||
/**
|
||||
* Ioctl flags
|
||||
*
|
||||
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
|
||||
index 60195e0..43f785f 100644
|
||||
--- a/lib/fuse_lowlevel.c
|
||||
+++ b/lib/fuse_lowlevel.c
|
||||
@@ -1882,6 +1882,8 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
|
||||
se->conn.capable |= FUSE_CAP_POSIX_ACL;
|
||||
if (arg->flags & FUSE_HANDLE_KILLPRIV)
|
||||
se->conn.capable |= FUSE_CAP_HANDLE_KILLPRIV;
|
||||
+ if (arg->flags & FUSE_CACHE_SYMLINKS)
|
||||
+ se->conn.capable |= FUSE_CAP_CACHE_SYMLINKS;
|
||||
if (!(arg->flags & FUSE_MAX_PAGES)) {
|
||||
size_t max_bufsize =
|
||||
FUSE_DEFAULT_MAX_PAGES_PER_REQ * getpagesize()
|
||||
@@ -2002,6 +2004,8 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
|
||||
outarg.flags |= FUSE_WRITEBACK_CACHE;
|
||||
if (se->conn.want & FUSE_CAP_POSIX_ACL)
|
||||
outarg.flags |= FUSE_POSIX_ACL;
|
||||
+ if (se->conn.want & FUSE_CAP_CACHE_SYMLINKS)
|
||||
+ outarg.flags |= FUSE_CACHE_SYMLINKS;
|
||||
outarg.max_readahead = se->conn.max_readahead;
|
||||
outarg.max_write = se->conn.max_write;
|
||||
if (se->conn.proto_minor >= 13) {
|
||||
--
|
||||
2.36.1
|
||||
|
@ -1,65 +0,0 @@
|
||||
From da57354dc8593d37eff59bc7836ee4e460a2659a Mon Sep 17 00:00:00 2001
|
||||
From: Nikolaus Rath <Nikolaus@rath.org>
|
||||
Date: Sat, 6 Apr 2019 18:34:57 +0100
|
||||
Subject: [PATCH 4/4] Add support for in-kernel readdir caching.
|
||||
|
||||
Fixes: #394.
|
||||
(cherry picked from commit 1552b467fcd7751360299c5139382d78538e12b3)
|
||||
Signed-off-by: Pavel Reichl <preichl@redhat.com>
|
||||
---
|
||||
include/fuse_common.h | 18 +++++++++++++-----
|
||||
lib/fuse_lowlevel.c | 2 ++
|
||||
2 files changed, 15 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/include/fuse_common.h b/include/fuse_common.h
|
||||
index a5a0ea5..a28ffa5 100644
|
||||
--- a/include/fuse_common.h
|
||||
+++ b/include/fuse_common.h
|
||||
@@ -45,9 +45,11 @@ struct fuse_file_info {
|
||||
/** Can be filled in by open, to use direct I/O on this file. */
|
||||
unsigned int direct_io : 1;
|
||||
|
||||
- /** Can be filled in by open, to indicate that currently
|
||||
- cached file data (that the filesystem provided the last
|
||||
- time the file was open) need not be invalidated. */
|
||||
+ /** Can be filled in by open. It signals the kernel that any
|
||||
+ currently cached file data (ie., data that the filesystem
|
||||
+ provided the last time the file was open) need not be
|
||||
+ invalidated. Has no effect when set in other contexts (in
|
||||
+ particular it does nothing when set by opendir()). */
|
||||
unsigned int keep_cache : 1;
|
||||
|
||||
/** Indicates a flush operation. Set in flush operation, also
|
||||
@@ -64,8 +66,14 @@ struct fuse_file_info {
|
||||
May only be set in ->release(). */
|
||||
unsigned int flock_release : 1;
|
||||
|
||||
- /** Padding. Do not use*/
|
||||
- unsigned int padding : 27;
|
||||
+ /** Can be filled in by opendir. It signals the kernel to
|
||||
+ enable caching of entries returned by readdir(). Has no
|
||||
+ effect when set in other contexts (in particular it does
|
||||
+ nothing when set by open()). */
|
||||
+ unsigned int cache_readdir : 1;
|
||||
+
|
||||
+ /** Padding. Reserved for future use*/
|
||||
+ unsigned int padding : 26;
|
||||
|
||||
/** File handle. May be filled in by filesystem in open().
|
||||
Available in all other file operations */
|
||||
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
|
||||
index 43f785f..6379e09 100644
|
||||
--- a/lib/fuse_lowlevel.c
|
||||
+++ b/lib/fuse_lowlevel.c
|
||||
@@ -392,6 +392,8 @@ static void fill_open(struct fuse_open_out *arg,
|
||||
arg->open_flags |= FOPEN_DIRECT_IO;
|
||||
if (f->keep_cache)
|
||||
arg->open_flags |= FOPEN_KEEP_CACHE;
|
||||
+ if (f->cache_readdir)
|
||||
+ arg->open_flags |= FOPEN_CACHE_DIR;
|
||||
if (f->nonseekable)
|
||||
arg->open_flags |= FOPEN_NONSEEKABLE;
|
||||
}
|
||||
--
|
||||
2.36.1
|
||||
|
@ -1,179 +0,0 @@
|
||||
From 4df08719f3415cde6f802a755922b7f76e198cd7 Mon Sep 17 00:00:00 2001
|
||||
From: Dharmendra Singh <dsingh@ddn.com>
|
||||
Date: Mon, 28 Feb 2022 11:15:06 +0000
|
||||
Subject: [PATCH] Modify structures in libfuse to handle flags beyond 32 bits.
|
||||
|
||||
In fuse kernel, 'commit 53db28933e95 ("fuse: extend init flags")'
|
||||
made the changes to handle flags going beyond 32 bits but i think
|
||||
changes were not done in libfuse to handle the same.
|
||||
|
||||
This patch prepares the ground in libfuse for incoming FUSE kernel
|
||||
patches (Atomic open + lookup) where flags went beyond 32 bits.
|
||||
It makes struct same as in fuse kernel resulting in name change of
|
||||
few fields.
|
||||
---
|
||||
include/fuse_kernel.h | 8 ++++-
|
||||
lib/fuse_lowlevel.c | 75 ++++++++++++++++++++++++++++----------------------
|
||||
2 files changed, 48 insertions(+), 35 deletions(-)
|
||||
|
||||
--- a/include/fuse_kernel.h
|
||||
+++ b/include/fuse_kernel.h
|
||||
@@ -272,6 +272,7 @@ struct fuse_file_lock {
|
||||
#define FUSE_POSIX_ACL (1 << 20)
|
||||
#define FUSE_MAX_PAGES (1 << 22)
|
||||
#define FUSE_CACHE_SYMLINKS (1 << 23)
|
||||
+#define FUSE_INIT_EXT (1 << 30)
|
||||
|
||||
/**
|
||||
* CUSE INIT request/reply flags
|
||||
@@ -596,6 +597,8 @@ struct fuse_init_in {
|
||||
uint32_t minor;
|
||||
uint32_t max_readahead;
|
||||
uint32_t flags;
|
||||
+ uint32_t flags2;
|
||||
+ uint32_t unused[11];
|
||||
};
|
||||
|
||||
#define FUSE_COMPAT_INIT_OUT_SIZE 8
|
||||
@@ -611,8 +614,9 @@ struct fuse_init_out {
|
||||
uint32_t max_write;
|
||||
uint32_t time_gran;
|
||||
uint16_t max_pages;
|
||||
- uint16_t padding;
|
||||
- uint32_t unused[8];
|
||||
+ uint16_t map_alignment;
|
||||
+ uint32_t flags2;
|
||||
+ uint32_t unused[7];
|
||||
};
|
||||
|
||||
#define CUSE_INIT_INFO_MAX 4096
|
||||
--- a/lib/fuse_lowlevel.c
|
||||
+++ b/lib/fuse_lowlevel.c
|
||||
@@ -1819,7 +1819,8 @@ static void do_init(fuse_req_t req, fuse
|
||||
struct fuse_session *se = req->se;
|
||||
size_t bufsize = se->bufsize;
|
||||
size_t outargsize = sizeof(outarg);
|
||||
-
|
||||
+ uint64_t inargflags = 0;
|
||||
+ uint64_t outargflags = 0;
|
||||
(void) nodeid;
|
||||
if (se->debug) {
|
||||
fprintf(stderr, "INIT: %u.%u\n", arg->major, arg->minor);
|
||||
@@ -1854,39 +1855,42 @@ static void do_init(fuse_req_t req, fuse
|
||||
if (arg->minor >= 6) {
|
||||
if (arg->max_readahead < se->conn.max_readahead)
|
||||
se->conn.max_readahead = arg->max_readahead;
|
||||
- if (arg->flags & FUSE_ASYNC_READ)
|
||||
+ inargflags = arg->flags;
|
||||
+ if (inargflags & FUSE_INIT_EXT)
|
||||
+ inargflags = inargflags | (uint64_t) arg->flags2 << 32;
|
||||
+ if (inargflags & FUSE_ASYNC_READ)
|
||||
se->conn.capable |= FUSE_CAP_ASYNC_READ;
|
||||
- if (arg->flags & FUSE_POSIX_LOCKS)
|
||||
+ if (inargflags & FUSE_POSIX_LOCKS)
|
||||
se->conn.capable |= FUSE_CAP_POSIX_LOCKS;
|
||||
- if (arg->flags & FUSE_ATOMIC_O_TRUNC)
|
||||
+ if (inargflags & FUSE_ATOMIC_O_TRUNC)
|
||||
se->conn.capable |= FUSE_CAP_ATOMIC_O_TRUNC;
|
||||
- if (arg->flags & FUSE_EXPORT_SUPPORT)
|
||||
+ if (inargflags & FUSE_EXPORT_SUPPORT)
|
||||
se->conn.capable |= FUSE_CAP_EXPORT_SUPPORT;
|
||||
- if (arg->flags & FUSE_DONT_MASK)
|
||||
+ if (inargflags & FUSE_DONT_MASK)
|
||||
se->conn.capable |= FUSE_CAP_DONT_MASK;
|
||||
- if (arg->flags & FUSE_FLOCK_LOCKS)
|
||||
+ if (inargflags & FUSE_FLOCK_LOCKS)
|
||||
se->conn.capable |= FUSE_CAP_FLOCK_LOCKS;
|
||||
- if (arg->flags & FUSE_AUTO_INVAL_DATA)
|
||||
+ if (inargflags & FUSE_AUTO_INVAL_DATA)
|
||||
se->conn.capable |= FUSE_CAP_AUTO_INVAL_DATA;
|
||||
- if (arg->flags & FUSE_DO_READDIRPLUS)
|
||||
+ if (inargflags & FUSE_DO_READDIRPLUS)
|
||||
se->conn.capable |= FUSE_CAP_READDIRPLUS;
|
||||
- if (arg->flags & FUSE_READDIRPLUS_AUTO)
|
||||
+ if (inargflags & FUSE_READDIRPLUS_AUTO)
|
||||
se->conn.capable |= FUSE_CAP_READDIRPLUS_AUTO;
|
||||
- if (arg->flags & FUSE_ASYNC_DIO)
|
||||
+ if (inargflags & FUSE_ASYNC_DIO)
|
||||
se->conn.capable |= FUSE_CAP_ASYNC_DIO;
|
||||
- if (arg->flags & FUSE_WRITEBACK_CACHE)
|
||||
+ if (inargflags & FUSE_WRITEBACK_CACHE)
|
||||
se->conn.capable |= FUSE_CAP_WRITEBACK_CACHE;
|
||||
- if (arg->flags & FUSE_NO_OPEN_SUPPORT)
|
||||
+ if (inargflags & FUSE_NO_OPEN_SUPPORT)
|
||||
se->conn.capable |= FUSE_CAP_NO_OPEN_SUPPORT;
|
||||
- if (arg->flags & FUSE_PARALLEL_DIROPS)
|
||||
+ if (inargflags & FUSE_PARALLEL_DIROPS)
|
||||
se->conn.capable |= FUSE_CAP_PARALLEL_DIROPS;
|
||||
- if (arg->flags & FUSE_POSIX_ACL)
|
||||
+ if (inargflags & FUSE_POSIX_ACL)
|
||||
se->conn.capable |= FUSE_CAP_POSIX_ACL;
|
||||
- if (arg->flags & FUSE_HANDLE_KILLPRIV)
|
||||
+ if (inargflags & FUSE_HANDLE_KILLPRIV)
|
||||
se->conn.capable |= FUSE_CAP_HANDLE_KILLPRIV;
|
||||
- if (arg->flags & FUSE_CACHE_SYMLINKS)
|
||||
+ if (inargflags & FUSE_CACHE_SYMLINKS)
|
||||
se->conn.capable |= FUSE_CAP_CACHE_SYMLINKS;
|
||||
- if (!(arg->flags & FUSE_MAX_PAGES)) {
|
||||
+ if (!(inargflags & FUSE_MAX_PAGES)) {
|
||||
size_t max_bufsize =
|
||||
FUSE_DEFAULT_MAX_PAGES_PER_REQ * getpagesize()
|
||||
+ FUSE_BUFFER_HEADER_SIZE;
|
||||
@@ -1977,37 +1981,42 @@ static void do_init(fuse_req_t req, fuse
|
||||
outarg.flags |= FUSE_MAX_PAGES;
|
||||
outarg.max_pages = (se->conn.max_write - 1) / getpagesize() + 1;
|
||||
}
|
||||
-
|
||||
+ outargflags = outarg.flags;
|
||||
/* Always enable big writes, this is superseded
|
||||
by the max_write option */
|
||||
- outarg.flags |= FUSE_BIG_WRITES;
|
||||
+ outargflags |= FUSE_BIG_WRITES;
|
||||
|
||||
if (se->conn.want & FUSE_CAP_ASYNC_READ)
|
||||
- outarg.flags |= FUSE_ASYNC_READ;
|
||||
+ outargflags |= FUSE_ASYNC_READ;
|
||||
if (se->conn.want & FUSE_CAP_POSIX_LOCKS)
|
||||
- outarg.flags |= FUSE_POSIX_LOCKS;
|
||||
+ outargflags |= FUSE_POSIX_LOCKS;
|
||||
if (se->conn.want & FUSE_CAP_ATOMIC_O_TRUNC)
|
||||
- outarg.flags |= FUSE_ATOMIC_O_TRUNC;
|
||||
+ outargflags |= FUSE_ATOMIC_O_TRUNC;
|
||||
if (se->conn.want & FUSE_CAP_EXPORT_SUPPORT)
|
||||
- outarg.flags |= FUSE_EXPORT_SUPPORT;
|
||||
+ outargflags |= FUSE_EXPORT_SUPPORT;
|
||||
if (se->conn.want & FUSE_CAP_DONT_MASK)
|
||||
- outarg.flags |= FUSE_DONT_MASK;
|
||||
+ outargflags |= FUSE_DONT_MASK;
|
||||
if (se->conn.want & FUSE_CAP_FLOCK_LOCKS)
|
||||
- outarg.flags |= FUSE_FLOCK_LOCKS;
|
||||
+ outargflags |= FUSE_FLOCK_LOCKS;
|
||||
if (se->conn.want & FUSE_CAP_AUTO_INVAL_DATA)
|
||||
- outarg.flags |= FUSE_AUTO_INVAL_DATA;
|
||||
+ outargflags |= FUSE_AUTO_INVAL_DATA;
|
||||
if (se->conn.want & FUSE_CAP_READDIRPLUS)
|
||||
- outarg.flags |= FUSE_DO_READDIRPLUS;
|
||||
+ outargflags |= FUSE_DO_READDIRPLUS;
|
||||
if (se->conn.want & FUSE_CAP_READDIRPLUS_AUTO)
|
||||
- outarg.flags |= FUSE_READDIRPLUS_AUTO;
|
||||
+ outargflags |= FUSE_READDIRPLUS_AUTO;
|
||||
if (se->conn.want & FUSE_CAP_ASYNC_DIO)
|
||||
- outarg.flags |= FUSE_ASYNC_DIO;
|
||||
+ outargflags |= FUSE_ASYNC_DIO;
|
||||
if (se->conn.want & FUSE_CAP_WRITEBACK_CACHE)
|
||||
- outarg.flags |= FUSE_WRITEBACK_CACHE;
|
||||
+ outargflags |= FUSE_WRITEBACK_CACHE;
|
||||
if (se->conn.want & FUSE_CAP_POSIX_ACL)
|
||||
- outarg.flags |= FUSE_POSIX_ACL;
|
||||
+ outargflags |= FUSE_POSIX_ACL;
|
||||
if (se->conn.want & FUSE_CAP_CACHE_SYMLINKS)
|
||||
- outarg.flags |= FUSE_CACHE_SYMLINKS;
|
||||
+ outargflags |= FUSE_CACHE_SYMLINKS;
|
||||
+
|
||||
+ outarg.flags = outargflags;
|
||||
+
|
||||
+ if (inargflags & FUSE_INIT_EXT)
|
||||
+ outarg.flags2 = outargflags >> 32;
|
||||
outarg.max_readahead = se->conn.max_readahead;
|
||||
outarg.max_write = se->conn.max_write;
|
||||
if (se->conn.proto_minor >= 13) {
|
@ -1,118 +0,0 @@
|
||||
From 22cc0c761ad23395a8220ce1954cfb8a64f36ff4 Mon Sep 17 00:00:00 2001
|
||||
From: HereThereBeDragons <HereThereBeDragons@users.noreply.github.com>
|
||||
Date: Thu, 27 Oct 2022 17:52:10 +0200
|
||||
Subject: [PATCH] Initial patch provided by Miklos Szeredi
|
||||
<mszeredi@redhat.com>
|
||||
|
||||
---
|
||||
include/fuse_kernel.h | 8 +++++++-
|
||||
include/fuse_lowlevel.h | 8 ++++++++
|
||||
lib/fuse_lowlevel.c | 18 ++++++++++++++----
|
||||
lib/fuse_versionscript | 1 +
|
||||
4 files changed, 30 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h
|
||||
index 09da620b5..e0666a1f7 100644
|
||||
--- a/include/fuse_kernel.h
|
||||
+++ b/include/fuse_kernel.h
|
||||
@@ -336,6 +336,12 @@
|
||||
*/
|
||||
#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
|
||||
|
||||
+/**
|
||||
+ * notify_inval_entry flags
|
||||
+ * FUSE_EXPIRE_ONLY
|
||||
+ */
|
||||
+#define FUSE_EXPIRE_ONLY (1 << 0)
|
||||
+
|
||||
enum fuse_opcode {
|
||||
FUSE_LOOKUP = 1,
|
||||
FUSE_FORGET = 2, /* no reply */
|
||||
@@ -800,7 +806,7 @@ struct fuse_notify_inval_inode_out {
|
||||
struct fuse_notify_inval_entry_out {
|
||||
uint64_t parent;
|
||||
uint32_t namelen;
|
||||
- uint32_t padding;
|
||||
+ uint32_t flags;
|
||||
};
|
||||
|
||||
struct fuse_notify_delete_out {
|
||||
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
|
||||
index 53f0fcf4b..c955cc4bb 100644
|
||||
--- a/include/fuse_lowlevel.h
|
||||
+++ b/include/fuse_lowlevel.h
|
||||
@@ -1675,6 +1675,14 @@ int fuse_lowlevel_notify_inval_inode(struct fuse_session *se, fuse_ino_t ino,
|
||||
int fuse_lowlevel_notify_inval_entry(struct fuse_session *se, fuse_ino_t parent,
|
||||
const char *name, size_t namelen);
|
||||
|
||||
+enum fuse_expire_flags {
|
||||
+ FUSE_LL_EXPIRE_ONLY = (1 << 0),
|
||||
+};
|
||||
+
|
||||
+int fuse_lowlevel_notify_expire_entry(struct fuse_session *se, fuse_ino_t parent,
|
||||
+ const char *name, size_t namelen,
|
||||
+ enum fuse_expire_flags flags);
|
||||
+
|
||||
/**
|
||||
* This function behaves like fuse_lowlevel_notify_inval_entry() with
|
||||
* the following additional effect (at least as of Linux kernel 4.8):
|
||||
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
|
||||
index e82cd9e9f..7b9d71043 100644
|
||||
--- a/lib/fuse_lowlevel.c
|
||||
+++ b/lib/fuse_lowlevel.c
|
||||
@@ -2161,21 +2161,24 @@
|
||||
return send_notify_iov(se, FUSE_NOTIFY_INVAL_INODE, iov, 2);
|
||||
}
|
||||
|
||||
-int fuse_lowlevel_notify_inval_entry(struct fuse_session *se, fuse_ino_t parent,
|
||||
- const char *name, size_t namelen)
|
||||
+int fuse_lowlevel_notify_expire_entry(struct fuse_session *se, fuse_ino_t parent,
|
||||
+ const char *name, size_t namelen,
|
||||
+ enum fuse_expire_flags flags)
|
||||
{
|
||||
struct fuse_notify_inval_entry_out outarg;
|
||||
struct iovec iov[3];
|
||||
|
||||
if (!se)
|
||||
return -EINVAL;
|
||||
-
|
||||
+
|
||||
if (se->conn.proto_major < 6 || se->conn.proto_minor < 12)
|
||||
return -ENOSYS;
|
||||
|
||||
outarg.parent = parent;
|
||||
outarg.namelen = namelen;
|
||||
- outarg.padding = 0;
|
||||
+ outarg.flags = 0;
|
||||
+ if (flags & FUSE_LL_EXPIRE_ONLY)
|
||||
+ outarg.flags |= FUSE_EXPIRE_ONLY;
|
||||
|
||||
iov[1].iov_base = &outarg;
|
||||
iov[1].iov_len = sizeof(outarg);
|
||||
@@ -2292,6 +2295,13 @@ int fuse_lowlevel_notify_inval_entry(struct fuse_session *se, fuse_ino_t parent,
|
||||
return send_notify_iov(se, FUSE_NOTIFY_INVAL_ENTRY, iov, 3);
|
||||
}
|
||||
|
||||
+int fuse_lowlevel_notify_inval_entry(struct fuse_session *se, fuse_ino_t parent,
|
||||
+ const char *name, size_t namelen)
|
||||
+{
|
||||
+ return fuse_lowlevel_notify_expire_entry(se, parent, name, namelen, 0);
|
||||
+}
|
||||
+
|
||||
+
|
||||
int fuse_lowlevel_notify_delete(struct fuse_session *se,
|
||||
fuse_ino_t parent, fuse_ino_t child,
|
||||
const char *name, size_t namelen)
|
||||
diff --git a/lib/fuse_versionscript b/lib/fuse_versionscript
|
||||
index 7e50e7507..795ea4aa9 100644
|
||||
--- a/lib/fuse_versionscript
|
||||
+++ b/lib/fuse_versionscript
|
||||
@@ -151,6 +151,7 @@
|
||||
FUSE_3.3 {
|
||||
global:
|
||||
fuse_open_channel;
|
||||
+ fuse_lowlevel_notify_expire_entry;
|
||||
} FUSE_3.2;
|
||||
|
||||
# Local Variables:
|
||||
|
@ -1,125 +0,0 @@
|
||||
From 6b1612e3a85b993f82124cccf149df3830e4a9c5 Mon Sep 17 00:00:00 2001
|
||||
From: HereThereBeDragons <HereThereBeDragons@users.noreply.github.com>
|
||||
Date: Thu, 27 Oct 2022 17:52:10 +0200
|
||||
Subject: [PATCH] adding comments and capability discovery, enum for flags
|
||||
moved to top of file
|
||||
|
||||
---
|
||||
example/printcap.c | 2 ++
|
||||
include/fuse_common.h | 16 ++++++++++++++++
|
||||
include/fuse_lowlevel.h | 40 ++++++++++++++++++++++++++++++++++++----
|
||||
lib/fuse_lowlevel.c | 2 ++
|
||||
4 files changed, 56 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/example/printcap.c b/example/printcap.c
|
||||
index edfd8f531..48679883c 100644
|
||||
--- a/example/printcap.c
|
||||
+++ b/example/printcap.c
|
||||
@@ -79,6 +79,8 @@
|
||||
printf("\tFUSE_CAP_POSIX_ACL\n");
|
||||
if(conn->capable & FUSE_CAP_CACHE_SYMLINKS)
|
||||
printf("\tFUSE_CAP_CACHE_SYMLINKS\n");
|
||||
+ if(conn->capable & FUSE_CAP_EXPIRE_ONLY)
|
||||
+ printf("\tFUSE_CAP_EXPIRE_ONLY\n");
|
||||
fuse_session_exit(se);
|
||||
}
|
||||
|
||||
diff --git a/include/fuse_common.h b/include/fuse_common.h
|
||||
index e9d874556..dbba05af8 100644
|
||||
--- a/include/fuse_common.h
|
||||
+++ b/include/fuse_common.h
|
||||
@@ -338,6 +338,22 @@
|
||||
#define FUSE_CAP_CACHE_SYMLINKS (1 << 23)
|
||||
|
||||
/**
|
||||
+ * Indicates support that dentries can be expired or invalidated.
|
||||
+ *
|
||||
+ * Expiring dentries, instead of invalidating them, makes a difference for
|
||||
+ * overmounted dentries, where plain invalidation would detach all submounts
|
||||
+ * before dropping the dentry from the cache. If only expiry is set on the
|
||||
+ * dentry, then any overmounts are left alone and until ->d_revalidate()
|
||||
+ * is called.
|
||||
+ *
|
||||
+ * Note: ->d_revalidate() is not called for the case of following a submount,
|
||||
+ * so invalidation will only be triggered for the non-overmounted case.
|
||||
+ * The dentry could also be mounted in a different mount instance, in which case
|
||||
+ * any submounts will still be detached.
|
||||
+*/
|
||||
+#define FUSE_CAP_EXPIRE_ONLY (1 << 26)
|
||||
+
|
||||
+/**
|
||||
* Ioctl flags
|
||||
*
|
||||
* FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine
|
||||
|
||||
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
|
||||
index c955cc4bb..6a1a5d534 100644
|
||||
--- a/include/fuse_lowlevel.h
|
||||
+++ b/include/fuse_lowlevel.h
|
||||
@@ -127,6 +127,15 @@ struct fuse_forget_data {
|
||||
uint64_t nlookup;
|
||||
};
|
||||
|
||||
+/**
|
||||
+ * Flags for fuse_lowlevel_notify_expire_entry()
|
||||
+ * 0 = invalidate entry
|
||||
+ * FUSE_LL_EXPIRE_ONLY = expire entry
|
||||
+*/
|
||||
+enum fuse_expire_flags {
|
||||
+ FUSE_LL_EXPIRE_ONLY = (1 << 0),
|
||||
+};
|
||||
+
|
||||
/* 'to_set' flags in setattr */
|
||||
#define FUSE_SET_ATTR_MODE (1 << 0)
|
||||
#define FUSE_SET_ATTR_UID (1 << 1)
|
||||
@@ -1675,10 +1684,33 @@ int fuse_lowlevel_notify_inval_inode(struct fuse_session *se, fuse_ino_t ino,
|
||||
int fuse_lowlevel_notify_inval_entry(struct fuse_session *se, fuse_ino_t parent,
|
||||
const char *name, size_t namelen);
|
||||
|
||||
-enum fuse_expire_flags {
|
||||
- FUSE_LL_EXPIRE_ONLY = (1 << 0),
|
||||
-};
|
||||
-
|
||||
+/**
|
||||
+ * Notify to expire or invalidate parent attributes and the dentry
|
||||
+ * matching parent/name
|
||||
+ *
|
||||
+ * Underlying function for fuse_lowlevel_notify_inval_entry().
|
||||
+ *
|
||||
+ * In addition to invalidating an entry, it also allows to expire an entry.
|
||||
+ * In that case, the entry is not forcefully removed from kernel cache
|
||||
+ * but instead the next access to it forces a lookup from the filesystem.
|
||||
+ *
|
||||
+ * This makes a difference for overmounted dentries, where plain invalidation
|
||||
+ * would detach all submounts before dropping the dentry from the cache.
|
||||
+ * If only expiry is set on the dentry, then any overmounts are left alone and
|
||||
+ * until ->d_revalidate() is called.
|
||||
+ *
|
||||
+ * Note: ->d_revalidate() is not called for the case of following a submount,
|
||||
+ * so invalidation will only be triggered for the non-overmounted case.
|
||||
+ * The dentry could also be mounted in a different mount instance, in which case
|
||||
+ * any submounts will still be detached.
|
||||
+ *
|
||||
+ * @param se the session object
|
||||
+ * @param parent inode number
|
||||
+ * @param name file name
|
||||
+ * @param namelen strlen() of file name
|
||||
+ * @param flags flags to control if the entry should be expired or invalidated
|
||||
+ * @return zero for success, -errno for failure
|
||||
+*/
|
||||
int fuse_lowlevel_notify_expire_entry(struct fuse_session *se, fuse_ino_t parent,
|
||||
const char *name, size_t namelen,
|
||||
enum fuse_expire_flags flags);
|
||||
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
|
||||
index 7b9d71043..7d7630925 100644
|
||||
--- a/lib/fuse_lowlevel.c
|
||||
+++ b/lib/fuse_lowlevel.c
|
||||
@@ -1991,6 +1991,8 @@ void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
|
||||
bufsize = max_bufsize;
|
||||
}
|
||||
}
|
||||
+ if (arg->minor >= 38)
|
||||
+ se->conn.capable |= FUSE_CAP_EXPIRE_ONLY;
|
||||
} else {
|
||||
se->conn.max_readahead = 0;
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
From: Miklos Szeredi <mszeredi@redhat.com>
|
||||
Subject: libfuse: add feature flag for expire-only
|
||||
|
||||
Add the FUSE_HAS_EXPIRE_ONLY flag. This should be used to set the
|
||||
FUSE_CAP_EXPIRE_ONLY capability flag on the low level API instead of
|
||||
checking for the version.
|
||||
|
||||
Checking the version doesn't work if the feature is backported to an
|
||||
earlier kernel.
|
||||
|
||||
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
|
||||
---
|
||||
include/fuse_kernel.h | 2 ++
|
||||
lib/fuse_lowlevel.c | 2 +-
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/include/fuse_kernel.h
|
||||
+++ b/include/fuse_kernel.h
|
||||
@@ -248,6 +248,7 @@
|
||||
* FUSE_POSIX_ACL: filesystem supports posix acls
|
||||
* FUSE_MAX_PAGES: init_out.max_pages contains the max number of req pages
|
||||
* FUSE_CACHE_SYMLINKS: cache READLINK responses
|
||||
+ * FUSE_HAS_EXPIRE_ONLY: kernel supports expiry-only entry invalidation
|
||||
*/
|
||||
#define FUSE_ASYNC_READ (1 << 0)
|
||||
#define FUSE_POSIX_LOCKS (1 << 1)
|
||||
@@ -272,6 +273,7 @@
|
||||
#define FUSE_MAX_PAGES (1 << 22)
|
||||
#define FUSE_CACHE_SYMLINKS (1 << 23)
|
||||
#define FUSE_INIT_EXT (1 << 30)
|
||||
+#define FUSE_HAS_EXPIRE_ONLY (1ULL << 35)
|
||||
|
||||
/**
|
||||
* CUSE INIT request/reply flags
|
||||
--- a/lib/fuse_lowlevel.c
|
||||
+++ b/lib/fuse_lowlevel.c
|
||||
@@ -2008,7 +2008,7 @@ void do_init(fuse_req_t req, fuse_ino_t
|
||||
bufsize = max_bufsize;
|
||||
}
|
||||
}
|
||||
- if (arg->minor >= 38)
|
||||
+ if (inargflags & FUSE_HAS_EXPIRE_ONLY)
|
||||
se->conn.capable |= FUSE_CAP_EXPIRE_ONLY;
|
||||
} else {
|
||||
se->conn.max_readahead = 0;
|
@ -1,150 +0,0 @@
|
||||
From 51bc827df873d9ff4069b83796cd32fcb6bd659e Mon Sep 17 00:00:00 2001
|
||||
From: HereThereBeDragons <HereThereBeDragons@users.noreply.github.com>
|
||||
Date: Fri, 30 Jun 2023 14:57:06 +0200
|
||||
Subject: [PATCH] Make expire only function fail if no kernel support (#789)
|
||||
|
||||
---
|
||||
include/fuse_common.h | 2 +-
|
||||
include/fuse_lowlevel.h | 28 ++++++++++++++--------------
|
||||
lib/fuse_lowlevel.c | 41 ++++++++++++++++++++++++++++++++++++-----
|
||||
3 files changed, 51 insertions(+), 20 deletions(-)
|
||||
|
||||
--- a/include/fuse_common.h
|
||||
+++ b/include/fuse_common.h
|
||||
@@ -338,7 +338,7 @@ struct fuse_loop_config {
|
||||
#define FUSE_CAP_CACHE_SYMLINKS (1 << 23)
|
||||
|
||||
/**
|
||||
- * Indicates support that dentries can be expired or invalidated.
|
||||
+ * Indicates support that dentries can be expired.
|
||||
*
|
||||
* Expiring dentries, instead of invalidating them, makes a difference for
|
||||
* overmounted dentries, where plain invalidation would detach all submounts
|
||||
--- a/include/fuse_lowlevel.h
|
||||
+++ b/include/fuse_lowlevel.h
|
||||
@@ -131,11 +131,12 @@ struct fuse_forget_data {
|
||||
};
|
||||
|
||||
/**
|
||||
- * Flags for fuse_lowlevel_notify_expire_entry()
|
||||
+ * Flags for fuse_lowlevel_notify_entry()
|
||||
* 0 = invalidate entry
|
||||
* FUSE_LL_EXPIRE_ONLY = expire entry
|
||||
*/
|
||||
-enum fuse_expire_flags {
|
||||
+enum fuse_notify_entry_flags {
|
||||
+ FUSE_LL_INVALIDATE = 0,
|
||||
FUSE_LL_EXPIRE_ONLY = (1 << 0),
|
||||
};
|
||||
|
||||
@@ -1560,8 +1561,7 @@ int fuse_lowlevel_notify_inval_inode(str
|
||||
off_t off, off_t len);
|
||||
|
||||
/**
|
||||
- * Notify to invalidate parent attributes and the dentry matching
|
||||
- * parent/name
|
||||
+ * Notify to invalidate parent attributes and the dentry matching parent/name
|
||||
*
|
||||
* To avoid a deadlock this function must not be called while
|
||||
* executing a related filesytem operation or while holding a lock
|
||||
@@ -1588,14 +1588,13 @@ int fuse_lowlevel_notify_inval_entry(str
|
||||
const char *name, size_t namelen);
|
||||
|
||||
/**
|
||||
- * Notify to expire or invalidate parent attributes and the dentry
|
||||
- * matching parent/name
|
||||
+ * Notify to expire parent attributes and the dentry matching parent/name
|
||||
*
|
||||
- * Underlying function for fuse_lowlevel_notify_inval_entry().
|
||||
+ * Same restrictions apply as for fuse_lowlevel_notify_inval_entry()
|
||||
*
|
||||
- * In addition to invalidating an entry, it also allows to expire an entry.
|
||||
- * In that case, the entry is not forcefully removed from kernel cache
|
||||
- * but instead the next access to it forces a lookup from the filesystem.
|
||||
+ * Compared to invalidating an entry, expiring the entry results not in a
|
||||
+ * forceful removal of that entry from kernel cache but instead the next access
|
||||
+ * to it forces a lookup from the filesystem.
|
||||
*
|
||||
* This makes a difference for overmounted dentries, where plain invalidation
|
||||
* would detach all submounts before dropping the dentry from the cache.
|
||||
@@ -1606,17 +1605,18 @@ int fuse_lowlevel_notify_inval_entry(str
|
||||
* so invalidation will only be triggered for the non-overmounted case.
|
||||
* The dentry could also be mounted in a different mount instance, in which case
|
||||
* any submounts will still be detached.
|
||||
+ *
|
||||
+ * Added in FUSE protocol version 7.38. If the kernel does not support
|
||||
+ * this (or a newer) version, the function will return -ENOSYS and do nothing.
|
||||
*
|
||||
* @param se the session object
|
||||
* @param parent inode number
|
||||
* @param name file name
|
||||
* @param namelen strlen() of file name
|
||||
- * @param flags flags to control if the entry should be expired or invalidated
|
||||
- * @return zero for success, -errno for failure
|
||||
+ * @return zero for success, -errno for failure, -enosys if no kernel support
|
||||
*/
|
||||
int fuse_lowlevel_notify_expire_entry(struct fuse_session *se, fuse_ino_t parent,
|
||||
- const char *name, size_t namelen,
|
||||
- enum fuse_expire_flags flags);
|
||||
+ const char *name, size_t namelen);
|
||||
|
||||
/**
|
||||
* This function behaves like fuse_lowlevel_notify_inval_entry() with
|
||||
--- a/lib/fuse_lowlevel.c
|
||||
+++ b/lib/fuse_lowlevel.c
|
||||
@@ -2172,9 +2172,28 @@ int fuse_lowlevel_notify_inval_inode(str
|
||||
return send_notify_iov(se, FUSE_NOTIFY_INVAL_INODE, iov, 2);
|
||||
}
|
||||
|
||||
-int fuse_lowlevel_notify_expire_entry(struct fuse_session *se, fuse_ino_t parent,
|
||||
- const char *name, size_t namelen,
|
||||
- enum fuse_expire_flags flags)
|
||||
+/**
|
||||
+ * Notify parent attributes and the dentry matching parent/name
|
||||
+ *
|
||||
+ * Underlying base function for fuse_lowlevel_notify_inval_entry() and
|
||||
+ * fuse_lowlevel_notify_expire_entry().
|
||||
+ *
|
||||
+ * @warning
|
||||
+ * Only checks if fuse_lowlevel_notify_inval_entry() is supported by
|
||||
+ * the kernel. All other flags will fall back to
|
||||
+ * fuse_lowlevel_notify_inval_entry() if not supported!
|
||||
+ * DO THE PROPER CHECKS IN THE DERIVED FUNCTION!
|
||||
+ *
|
||||
+ * @param se the session object
|
||||
+ * @param parent inode number
|
||||
+ * @param name file name
|
||||
+ * @param namelen strlen() of file name
|
||||
+ * @param flags flags to control if the entry should be expired or invalidated
|
||||
+ * @return zero for success, -errno for failure
|
||||
+*/
|
||||
+static int fuse_lowlevel_notify_entry(struct fuse_session *se, fuse_ino_t parent,
|
||||
+ const char *name, size_t namelen,
|
||||
+ enum fuse_notify_entry_flags flags)
|
||||
{
|
||||
struct fuse_notify_inval_entry_out outarg;
|
||||
struct iovec iov[3];
|
||||
@@ -2200,9 +2219,21 @@ int fuse_lowlevel_notify_expire_entry(st
|
||||
}
|
||||
|
||||
int fuse_lowlevel_notify_inval_entry(struct fuse_session *se, fuse_ino_t parent,
|
||||
- const char *name, size_t namelen)
|
||||
+ const char *name, size_t namelen)
|
||||
+{
|
||||
+ return fuse_lowlevel_notify_entry(se, parent, name, namelen, FUSE_LL_INVALIDATE);
|
||||
+}
|
||||
+
|
||||
+int fuse_lowlevel_notify_expire_entry(struct fuse_session *se, fuse_ino_t parent,
|
||||
+ const char *name, size_t namelen)
|
||||
{
|
||||
- return fuse_lowlevel_notify_expire_entry(se, parent, name, namelen, 0);
|
||||
+ if (!se)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (!(se->conn.capable & FUSE_CAP_EXPIRE_ONLY))
|
||||
+ return -ENOSYS;
|
||||
+
|
||||
+ return fuse_lowlevel_notify_entry(se, parent, name, namelen, FUSE_LL_EXPIRE_ONLY);
|
||||
}
|
||||
|
||||
|
@ -1,21 +0,0 @@
|
||||
diff -up fuse-2.9.2/include/fuse_kernel.h.conflictfix fuse-2.9.2/include/fuse_kernel.h
|
||||
--- fuse-2.9.2/include/fuse_kernel.h.conflictfix 2013-06-26 09:31:57.862198038 -0400
|
||||
+++ fuse-2.9.2/include/fuse_kernel.h 2013-06-26 09:32:19.679198365 -0400
|
||||
@@ -88,12 +88,16 @@
|
||||
#ifndef _LINUX_FUSE_H
|
||||
#define _LINUX_FUSE_H
|
||||
|
||||
-#include <sys/types.h>
|
||||
+#ifdef __linux__
|
||||
+#include <linux/types.h>
|
||||
+#else
|
||||
+#include <stdint.h>
|
||||
#define __u64 uint64_t
|
||||
#define __s64 int64_t
|
||||
#define __u32 uint32_t
|
||||
#define __s32 int32_t
|
||||
#define __u16 uint16_t
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Version negotiation:
|
@ -1,13 +0,0 @@
|
||||
diff -up libfuse-fuse-3.0.0/lib/fuse.c.parens libfuse-fuse-3.0.0/lib/fuse.c
|
||||
--- libfuse-fuse-3.0.0/lib/fuse.c.parens 2017-03-21 09:31:31.979537796 -0400
|
||||
+++ libfuse-fuse-3.0.0/lib/fuse.c 2017-03-21 09:31:42.676250718 -0400
|
||||
@@ -1653,7 +1653,7 @@ int fuse_fs_open(struct fuse_fs *fs, con
|
||||
fprintf(stderr, "open flags: 0x%x %s\n", fi->flags,
|
||||
path);
|
||||
|
||||
- err = fs->op.open(path, fi);
|
||||
+ err = (fs->op.open)(path, fi);
|
||||
|
||||
if (fs->debug && !err)
|
||||
fprintf(stderr, " open[%llu] flags: 0x%x %s\n",
|
||||
diff -up libfuse-fuse-3.0.0/lib/fuse_lowlevel.c.parens libfuse-fuse-3.0.0/lib/fuse_lowlevel.c
|
@ -1,11 +0,0 @@
|
||||
--- libfuse-fuse-3.3.0/test/test_syscalls.c.orig 2018-11-06 19:57:47.000000000 +0100
|
||||
+++ libfuse-fuse-3.3.0/test/test_syscalls.c 2022-02-07 17:17:47.512515240 +0100
|
||||
@@ -1511,7 +1511,7 @@
|
||||
|
||||
errno = 0;
|
||||
res = rename(PATH("a/b"), PATH2("a/d"));
|
||||
- if (res == 0 || errno != ENOTEMPTY) {
|
||||
+ if (res == 0 || (errno != ENOTEMPTY && errno != EEXIST)) {
|
||||
PERROR("rename");
|
||||
goto fail;
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
From 2c736f516f28dfb5c58aff345c668a5ea6386295 Mon Sep 17 00:00:00 2001
|
||||
From: Miklos Szeredi <mszeredi@redhat.com>
|
||||
Date: Wed, 10 Jan 2024 10:15:43 +0100
|
||||
Subject: [PATCH] Don't set FUSE_CAP_PARALLEL_DIROPS by default
|
||||
|
||||
Allowing parallel dir operations could result in a crash in a filesystem
|
||||
implementation that is not prepared for this.
|
||||
|
||||
To be safe keep this flag off by default (this is not a regression, since
|
||||
there was no public release where this flag wasn't ignored).
|
||||
|
||||
If the filesystem wants better performance, then it should set this flag
|
||||
explicitly.
|
||||
|
||||
Fixes: c9905341ea34 ("Pass FUSE_PARALLEL_DIROPS to kernel (#861)")
|
||||
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
|
||||
---
|
||||
include/fuse_common.h | 2 --
|
||||
lib/fuse_lowlevel.c | 1 -
|
||||
2 files changed, 3 deletions(-)
|
||||
|
||||
--- a/include/fuse_common.h
|
||||
+++ b/include/fuse_common.h
|
||||
@@ -313,8 +313,6 @@ struct fuse_loop_config {
|
||||
* is unset, the FUSE kernel module will ensure that lookup() and
|
||||
* readdir() requests are never issued concurrently for the same
|
||||
* directory.
|
||||
- *
|
||||
- * This feature is enabled by default when supported by the kernel.
|
||||
*/
|
||||
#define FUSE_CAP_PARALLEL_DIROPS (1 << 18)
|
||||
|
||||
--- a/lib/fuse_lowlevel.c
|
||||
+++ b/lib/fuse_lowlevel.c
|
||||
@@ -2009,7 +2009,6 @@ void do_init(fuse_req_t req, fuse_ino_t
|
||||
if ((cond) && (se->conn.capable & (cap))) \
|
||||
se->conn.want |= (cap)
|
||||
LL_SET_DEFAULT(1, FUSE_CAP_ASYNC_READ);
|
||||
- LL_SET_DEFAULT(1, FUSE_CAP_PARALLEL_DIROPS);
|
||||
LL_SET_DEFAULT(1, FUSE_CAP_AUTO_INVAL_DATA);
|
||||
LL_SET_DEFAULT(1, FUSE_CAP_HANDLE_KILLPRIV);
|
||||
LL_SET_DEFAULT(1, FUSE_CAP_ASYNC_DIO);
|
@ -1,23 +0,0 @@
|
||||
From c9905341ea34ff9acbc11b3c53ba8bcea35eeed8 Mon Sep 17 00:00:00 2001
|
||||
From: fdinoff <fdinoff@google.com>
|
||||
Date: Thu, 16 Nov 2023 06:23:20 -0500
|
||||
Subject: [PATCH] Pass FUSE_PARALLEL_DIROPS to kernel (#861)
|
||||
|
||||
This tells the kernel that parallel lookup/readdir operations are
|
||||
supported. This is enabled by default but was not passed to the kernel
|
||||
so you always get the synchronized version.
|
||||
---
|
||||
lib/fuse_lowlevel.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/lib/fuse_lowlevel.c
|
||||
+++ b/lib/fuse_lowlevel.c
|
||||
@@ -2093,6 +2093,8 @@ void do_init(fuse_req_t req, fuse_ino_t
|
||||
outargflags |= FUSE_ASYNC_DIO;
|
||||
if (se->conn.want & FUSE_CAP_WRITEBACK_CACHE)
|
||||
outargflags |= FUSE_WRITEBACK_CACHE;
|
||||
+ if (se->conn.want & FUSE_CAP_PARALLEL_DIROPS)
|
||||
+ outargflags |= FUSE_PARALLEL_DIROPS;
|
||||
if (se->conn.want & FUSE_CAP_POSIX_ACL)
|
||||
outargflags |= FUSE_POSIX_ACL;
|
||||
if (se->conn.want & FUSE_CAP_CACHE_SYMLINKS)
|
@ -1,22 +0,0 @@
|
||||
--- libfuse-fuse-3.3.0/util/install_helper.orig 2022-01-31 20:17:39.461137935 +0100
|
||||
+++ libfuse-fuse-3.3.0/util/install_helper.sh 2022-01-31 20:18:46.093188655 +0100
|
||||
@@ -22,18 +22,12 @@
|
||||
DESTDIR="${DESTDIR%/}"
|
||||
fi
|
||||
|
||||
-chown root:root "${DESTDIR}${bindir}/fusermount3"
|
||||
+#chown root:root "${DESTDIR}${bindir}/fusermount3"
|
||||
chmod u+s "${DESTDIR}${bindir}/fusermount3"
|
||||
|
||||
install -D -m 644 "${MESON_SOURCE_ROOT}/util/fuse.conf" \
|
||||
"${DESTDIR}${sysconfdir}/fuse.conf"
|
||||
|
||||
-
|
||||
-if test ! -e "${DESTDIR}/dev/fuse"; then
|
||||
- mkdir -p "${DESTDIR}/dev"
|
||||
- mknod "${DESTDIR}/dev/fuse" -m 0666 c 10 229
|
||||
-fi
|
||||
-
|
||||
install -D -m 644 "${MESON_SOURCE_ROOT}/util/udev.rules" \
|
||||
"${DESTDIR}${udevrulesdir}/99-fuse3.rules"
|
||||
|
@ -1,2 +0,0 @@
|
||||
# mount_max = 1000
|
||||
# user_allow_other
|
@ -1,47 +0,0 @@
|
||||
From 520f09be3c2d351722c33daf7389d6ac4716be98 Mon Sep 17 00:00:00 2001
|
||||
From: Jann Horn <jannh@google.com>
|
||||
Date: Fri, 13 Jul 2018 15:15:36 -0700
|
||||
Subject: [PATCH] fusermount: don't feed "escaped commas" into mount options
|
||||
|
||||
The old code permits the following behavior:
|
||||
|
||||
$ _FUSE_COMMFD=10000 priv_strace -etrace=mount -s200 fusermount -o 'foobar=\,allow_other' mount
|
||||
mount("/dev/fuse", ".", "fuse", MS_NOSUID|MS_NODEV, "foobar=\\,allow_other,fd=3,rootmode=40000,user_id=1000,group_id=1000") = -1 EINVAL (Invalid argument)
|
||||
|
||||
However, backslashes do not have any special meaning for the kernel here.
|
||||
|
||||
As it happens, you can't abuse this because there is no FUSE mount option
|
||||
that takes a string value that can contain backslashes; but this is very
|
||||
brittle. Don't interpret "escape characters" in places where they don't
|
||||
work.
|
||||
---
|
||||
util/fusermount.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/util/fusermount.c b/util/fusermount.c
|
||||
index 26a0b75bbecb..5175c0115a05 100644
|
||||
--- a/util/fusermount.c
|
||||
+++ b/util/fusermount.c
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sched.h>
|
||||
+#include <stdbool.h>
|
||||
|
||||
#define FUSE_COMMFD_ENV "_FUSE_COMMFD"
|
||||
|
||||
@@ -739,8 +740,10 @@ static int do_mount(const char *mnt, char **typep, mode_t rootmode,
|
||||
unsigned len;
|
||||
const char *fsname_str = "fsname=";
|
||||
const char *subtype_str = "subtype=";
|
||||
+ bool escape_ok = begins_with(s, fsname_str) ||
|
||||
+ begins_with(s, subtype_str);
|
||||
for (len = 0; s[len]; len++) {
|
||||
- if (s[len] == '\\' && s[len + 1])
|
||||
+ if (escape_ok && s[len] == '\\' && s[len + 1])
|
||||
len++;
|
||||
else if (s[len] == ',')
|
||||
break;
|
||||
--
|
||||
2.14.3
|
||||
|
@ -1,66 +1,46 @@
|
||||
%global fuse2ver 2.9.7
|
||||
%global fuse2sver 2
|
||||
%global fuse3ver 3.3.0
|
||||
|
||||
Name: fuse
|
||||
Version: %{fuse2ver}
|
||||
Release: 19%{?dist}
|
||||
Version: 2.9.9
|
||||
Release: 17%{?dist}
|
||||
Summary: File System in Userspace (FUSE) v2 utilities
|
||||
License: GPL+
|
||||
URL: http://fuse.sf.net
|
||||
#fuse2 sources
|
||||
Source0: https://github.com/libfuse/libfuse/archive/%{name}-%{fuse2ver}.tar.gz
|
||||
#fuse3 sources
|
||||
Source1: https://github.com/libfuse/libfuse/archive/%{name}-%{fuse3ver}.tar.gz
|
||||
Source2: %{name}.conf
|
||||
Source0: https://github.com/libfuse/libfuse/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz
|
||||
|
||||
Patch1: fuse-3.0.0-More-parentheses.patch
|
||||
Patch2: fuse-0001-More-parentheses.patch
|
||||
Patch1: fuse2-0001-More-parentheses.patch
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=970768
|
||||
Patch3: fuse-2.9.2-namespace-conflict-fix.patch
|
||||
Patch4: fuse-3.2.1-no-dev.patch
|
||||
Patch5: fusermount-don-t-feed-escaped-commas-into-mount-opti.patch
|
||||
Patch6: buffer_size.patch
|
||||
Patch7: fuse-3.10.4-fix-test-failure.patch
|
||||
Patch8: 0001-Synchronize-fuse_kernel.h.patch
|
||||
Patch9: 0002-fuse_lowlevel-Add-max_pages-support-384.patch
|
||||
Patch10: 0003-Allow-caching-symlinks-in-kernel-page-cache.-551.patch
|
||||
Patch11: 0004-Add-support-for-in-kernel-readdir-caching.patch
|
||||
Patch12: 0005-BZ_217095_Modify-structures-in-libfuse-to-handle-flags-beyond-rhel-8.patch
|
||||
Patch13: 0006-BZ_2171095.patch
|
||||
Patch14: 0007-BZ_2171095-cap.patch
|
||||
Patch15: 0008-BZ_217095-libfuse-add-feature-flag-for-expire-only.patch
|
||||
Patch16: fuse-3.17.0-Pass-FUSE_PARALLEL_DIROPS-to-kernel-861.patch
|
||||
Patch17: fuse-3.17.0-Don-t-set-FUSE_CAP_PARALLEL_DIROPS-by-default.patch
|
||||
Patch18: 0009-Make-expire-only-function-fail-if-no-kernel-support-.patch
|
||||
Patch2: fuse2-0002-add-fix-for-namespace-conflict-in-fuse_kernel.h.patch
|
||||
# https://github.com/libfuse/libfuse/commit/4f8f034a8969a48f210bf00be78a67cfb6964c72
|
||||
# backported for fuse2
|
||||
Patch3: fuse2-0003-make-buffer-size-match-kernel-max-transfer-size.patch
|
||||
# https://bugzilla.redhat.com/1694552#c7
|
||||
# https://github.com/libfuse/libfuse/pull/392
|
||||
# backported for fuse2
|
||||
Patch4: fuse2-0004-Whitelist-SMB2-found-on-some-NAS-devices.patch
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1984778
|
||||
# https://github.com/libfuse/libfuse/pull/619
|
||||
# https://github.com/libfuse/libfuse/commit/ae2352bca9b4e607538412da0cc2a9625cd8b692.patch
|
||||
Patch5: fuse2-0005-remove-closefrom-function.patch
|
||||
Patch6: fuse2-0006-master-libfuse-null-terminate-buffer-in-fuse_req_getgroups.patch
|
||||
|
||||
# Default to *do* run autoreconf, because in case any downstream patch touched
|
||||
# configure.ac or Makefile.am it may be necessary to do so - e.g Patch #5.
|
||||
%{!?enable_autotools: %global enable_autotools 1}
|
||||
|
||||
Requires: which
|
||||
Conflicts: filesystem < 3
|
||||
BuildRequires: libselinux-devel
|
||||
BuildRequires: autoconf, automake, libtool, gettext-devel
|
||||
BuildRequires: meson, ninja-build, systemd-udev
|
||||
Requires: fuse-common = %{fuse3ver}
|
||||
BuildRequires: autoconf, automake, libtool, gettext-devel, make
|
||||
BuildRequires: systemd-udev
|
||||
# fuse-common 3.4.2-3 and earlier included man pages
|
||||
Requires: fuse-common >= 3.4.2-4
|
||||
|
||||
%description
|
||||
With FUSE it is possible to implement a fully functional filesystem in a
|
||||
userspace program. This package contains the FUSE v2 userspace tools to
|
||||
mount a FUSE filesystem.
|
||||
|
||||
%package -n fuse3
|
||||
Version: %{fuse3ver}
|
||||
Summary: File System in Userspace (FUSE) v3 utilitie
|
||||
Requires: fuse-common = %{fuse3ver}
|
||||
Requires: fuse3-libs = %{fuse3ver}-%{release}
|
||||
|
||||
%description -n fuse3
|
||||
With FUSE it is possible to implement a fully functional filesystem in a
|
||||
userspace program. This package contains the FUSE v3 userspace tools to
|
||||
mount a FUSE filesystem.
|
||||
|
||||
%package libs
|
||||
Version: %{fuse2ver}
|
||||
Summary: File System in Userspace (FUSE) v2 libraries
|
||||
Group: System Environment/Libraries
|
||||
License: LGPLv2+
|
||||
Conflicts: filesystem < 3
|
||||
|
||||
@ -68,22 +48,9 @@ Conflicts: filesystem < 3
|
||||
Devel With FUSE it is possible to implement a fully functional filesystem in a
|
||||
userspace program. This package contains the FUSE v2 libraries.
|
||||
|
||||
%package -n fuse3-libs
|
||||
Version: %{fuse3ver}
|
||||
Summary: File System in Userspace (FUSE) v3 libraries
|
||||
Group: System Environment/Libraries
|
||||
License: LGPLv2+
|
||||
Conflicts: filesystem < 3
|
||||
|
||||
%description -n fuse3-libs
|
||||
Devel With FUSE it is possible to implement a fully functional filesystem in a
|
||||
userspace program. This package contains the FUSE v3 libraries.
|
||||
|
||||
%package devel
|
||||
Version: %{fuse2ver}
|
||||
Summary: File System in Userspace (FUSE) v2 devel files
|
||||
Group: Development/Libraries
|
||||
Requires: %{name}-libs = %{fuse2ver}-%{release}
|
||||
Requires: %{name}-libs = %{version}-%{release}
|
||||
Requires: pkgconfig
|
||||
License: LGPLv2+
|
||||
Conflicts: filesystem < 3
|
||||
@ -93,98 +60,36 @@ With FUSE it is possible to implement a fully functional filesystem in a
|
||||
userspace program. This package contains development files (headers,
|
||||
pgk-config) to develop FUSE v2 based applications/filesystems.
|
||||
|
||||
%package -n fuse3-devel
|
||||
Version: %{fuse3ver}
|
||||
Summary: File System in Userspace (FUSE) v3 devel files
|
||||
Group: Development/Libraries
|
||||
Requires: %{name}3-libs = %{fuse3ver}-%{release}
|
||||
Requires: pkgconfig
|
||||
License: LGPLv2+
|
||||
Conflicts: filesystem < 3
|
||||
|
||||
%description -n fuse3-devel
|
||||
With FUSE it is possible to implement a fully functional filesystem in a
|
||||
userspace program. This package contains development files (headers,
|
||||
pgk-config) to develop FUSE v3 based applications/filesystems.
|
||||
|
||||
%package common
|
||||
Version: %{fuse3ver}
|
||||
Summary: Common files for File System in Userspace (FUSE) v2 and v3
|
||||
License: GPL+
|
||||
|
||||
%description common
|
||||
Common files for FUSE v2 and FUSE v3.
|
||||
|
||||
%prep
|
||||
%setup -q -T -c -n fuse2and3 -a0 -a1
|
||||
%setup
|
||||
|
||||
# fuse 3
|
||||
pushd lib%{name}-%{name}-%{fuse3ver}
|
||||
%patch1 -p1 -b .add_parentheses
|
||||
%patch4 -p1 -b .nodev
|
||||
%patch7 -p1 -b .test_fail
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
%patch18 -p1
|
||||
|
||||
popd
|
||||
|
||||
# fuse 2
|
||||
pushd lib%{name}-%{name}-%{fuse2ver}
|
||||
./makeconf.sh
|
||||
# ./makeconf.sh
|
||||
#disable device creation during build/install
|
||||
sed -i 's|mknod|echo Disabled: mknod |g' util/Makefile.in
|
||||
%patch2 -p1 -b .add_parentheses
|
||||
%patch3 -p1 -b .conflictfix
|
||||
%patch5 -p1 -b .escaped_commas
|
||||
%patch6 -p1 -b .buffer_size
|
||||
popd
|
||||
%patch1 -p1 -b .add_parentheses
|
||||
%patch2 -p1 -b .conflictfix
|
||||
%patch3 -p1 -b .buffer_size
|
||||
%patch4 -p1 -b .smb2_whitelist
|
||||
%patch5 -p1 -b .remove_closefrom
|
||||
%patch6 -p1 -b .fix_null_terminate
|
||||
|
||||
%build
|
||||
# fuse 3
|
||||
pushd lib%{name}-%{name}-%{fuse3ver}
|
||||
%meson
|
||||
%meson_build
|
||||
%if 0
|
||||
# Can't pass --disable-static here, or else the utils don't build
|
||||
export MOUNT_FUSE_PATH="%{_sbindir}"
|
||||
CFLAGS="%{optflags} -D_GNU_SOURCE" %configure
|
||||
make %{?_smp_mflags} V=1
|
||||
%if 0%{?enable_autotools}
|
||||
autoreconf -if
|
||||
%endif
|
||||
popd
|
||||
|
||||
# fuse 2
|
||||
pushd lib%{name}-%{name}-%{fuse2ver}
|
||||
# Can't pass --disable-static here, or else the utils don't build
|
||||
export MOUNT_FUSE_PATH="%{_sbindir}"
|
||||
CFLAGS="%{optflags} -D_GNU_SOURCE" %configure
|
||||
make %{?_smp_mflags}
|
||||
popd
|
||||
|
||||
%install
|
||||
# fuse 3
|
||||
pushd lib%{name}-%{name}-%{fuse3ver}
|
||||
export MESON_INSTALL_DESTDIR_PREFIX=%{buildroot}/usr %meson_install
|
||||
popd
|
||||
find %{buildroot} .
|
||||
find %{buildroot} -type f -name "*.la" -exec rm -f {} ';'
|
||||
# change from 4755 to 0755 to allow stripping -- fixed later in files
|
||||
chmod 0755 %{buildroot}/%{_bindir}/fusermount3
|
||||
|
||||
# fuse 2
|
||||
pushd lib%{name}-%{name}-%{fuse2ver}
|
||||
install -m 0755 lib/.libs/libfuse.so.%{fuse2ver} %{buildroot}/%{_libdir}
|
||||
mkdir -p %{buildroot}/%{_libdir}/pkgconfig
|
||||
install -m 0755 lib/.libs/libfuse.so.%{version} %{buildroot}/%{_libdir}
|
||||
install -m 0755 lib/.libs/libulockmgr.so.1.0.1 %{buildroot}/%{_libdir}
|
||||
install -p fuse.pc %{buildroot}/%{_libdir}/pkgconfig/
|
||||
mkdir -p %{buildroot}/%{_bindir}
|
||||
install -m 0755 util/fusermount %{buildroot}/%{_bindir}
|
||||
mkdir -p %{buildroot}/%{_sbindir}
|
||||
install -m 0755 util/mount.fuse %{buildroot}/%{_sbindir}
|
||||
install -m 0755 util/ulockmgr_server %{buildroot}/%{_bindir}
|
||||
mkdir -p %{buildroot}/%{_includedir}/fuse
|
||||
@ -193,64 +98,36 @@ install -p include/ulockmgr.h %{buildroot}/%{_includedir}/
|
||||
for i in cuse_lowlevel.h fuse_common_compat.h fuse_common.h fuse_compat.h fuse.h fuse_lowlevel_compat.h fuse_lowlevel.h fuse_opt.h; do
|
||||
install -p include/$i %{buildroot}/%{_includedir}/fuse/
|
||||
done
|
||||
popd
|
||||
mkdir -p %{buildroot}/%{_mandir}/man1/
|
||||
cp -a doc/fusermount.1 doc/ulockmgr_server.1 %{buildroot}/%{_mandir}/man1/
|
||||
mkdir -p %{buildroot}/%{_mandir}/man8/
|
||||
cp -a doc/mount.fuse.8 %{buildroot}/%{_mandir}/man8/
|
||||
pushd %{buildroot}/%{_libdir}
|
||||
ln -s libfuse.so.%{fuse2ver} libfuse.so.%{fuse2sver}
|
||||
ln -s libfuse.so.%{fuse2ver} libfuse.so
|
||||
ln -s libfuse.so.%{version} libfuse.so.2
|
||||
ln -s libfuse.so.%{version} libfuse.so
|
||||
ln -s libulockmgr.so.1.0.1 libulockmgr.so.1
|
||||
ln -s libulockmgr.so.1.0.1 libulockmgr.so
|
||||
popd
|
||||
pushd %{buildroot}/%{_mandir}/man8
|
||||
ln -s mount.fuse3.8 mount.fuse.8
|
||||
popd
|
||||
|
||||
# Get rid of static libs
|
||||
rm -f %{buildroot}/%{_libdir}/*.a
|
||||
# No need to create init-script
|
||||
rm -f %{buildroot}%{_sysconfdir}/init.d/fuse3
|
||||
|
||||
# Install config-file
|
||||
install -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}
|
||||
|
||||
# Delete pointless udev rules, which do not belong in /etc (brc#748204)
|
||||
rm -f %{buildroot}/usr/lib/udev/rules.d/99-fuse3.rules
|
||||
|
||||
%post libs -p /sbin/ldconfig
|
||||
|
||||
%post -n fuse3-libs -p /sbin/ldconfig
|
||||
|
||||
%postun libs -p /sbin/ldconfig
|
||||
|
||||
%postun -n fuse3-libs -p /sbin/ldconfig
|
||||
%ldconfig_scriptlets libs
|
||||
|
||||
%files
|
||||
%license libfuse-fuse-%{fuse2ver}/COPYING
|
||||
%doc libfuse-fuse-%{fuse2ver}/AUTHORS libfuse-fuse-%{fuse2ver}/ChangeLog libfuse-fuse-%{fuse2ver}/NEWS libfuse-fuse-%{fuse2ver}/README.md libfuse-fuse-%{fuse2ver}/README.NFS
|
||||
%license COPYING
|
||||
%doc AUTHORS ChangeLog NEWS README.md README.NFS
|
||||
%{_sbindir}/mount.fuse
|
||||
%attr(4755,root,root) %{_bindir}/fusermount
|
||||
%{_bindir}/ulockmgr_server
|
||||
|
||||
%files -n fuse3
|
||||
%license libfuse-fuse-%{fuse3ver}/GPL2.txt libfuse-fuse-%{fuse3ver}/LICENSE
|
||||
|
||||
%doc libfuse-fuse-%{fuse3ver}/AUTHORS libfuse-fuse-%{fuse3ver}/ChangeLog.rst libfuse-fuse-%{fuse3ver}/README.md
|
||||
%{_sbindir}/mount.fuse3
|
||||
%attr(4755,root,root) %{_bindir}/fusermount3
|
||||
|
||||
%files common
|
||||
%config(noreplace) %{_sysconfdir}/%{name}.conf
|
||||
%{_mandir}/man1/*
|
||||
%{_mandir}/man8/*
|
||||
|
||||
%files libs
|
||||
%license libfuse-fuse-%{fuse2ver}/COPYING.LIB
|
||||
%license COPYING.LIB
|
||||
%{_libdir}/libfuse.so.*
|
||||
%{_libdir}/libulockmgr.so.*
|
||||
|
||||
%files -n fuse3-libs
|
||||
%license libfuse-fuse-%{fuse3ver}/LGPL2.txt
|
||||
%{_libdir}/libfuse3.so.*
|
||||
|
||||
%files devel
|
||||
%{_libdir}/libfuse.so
|
||||
%{_libdir}/libulockmgr.so
|
||||
@ -259,44 +136,80 @@ rm -f %{buildroot}/usr/lib/udev/rules.d/99-fuse3.rules
|
||||
%{_includedir}/ulockmgr.h
|
||||
%{_includedir}/fuse
|
||||
|
||||
%files -n fuse3-devel
|
||||
%{_libdir}/libfuse3.so
|
||||
%{_libdir}/pkgconfig/fuse3.pc
|
||||
%{_includedir}/fuse3/
|
||||
|
||||
%changelog
|
||||
* Tue Feb 06 2024 Pavel Reichl <preichl@redhat.com> - 2.9.7-19
|
||||
- Synchronize expire-only API with upstream.
|
||||
- Related: RHEL-23415
|
||||
* Mon Dec 02 2024 Pavel Reichl <preichl@redhat.com>
|
||||
- Bump release to test gating
|
||||
Related: RHEL-69609
|
||||
|
||||
* Fri Feb 02 2024 Pavel Reichl <preichl@redhat.com> - 2.9.7-18
|
||||
- Advertise support of FUSE_PARALLEL_DIROPS to kernel
|
||||
- Fixes RHEL-19149
|
||||
* Fri Jun 14 2024 Pavel Reichl <preichl@redhat.com> - 2.9.9-16
|
||||
- null-terminate buffer in fuse_req_getgroups()
|
||||
|
||||
* Thu Mar 23 2023 Pavel Reichl <preichl@redhat.com> - 2.9.7-17
|
||||
- Add feature_notify_inode_expire_only
|
||||
- Fixes rhbz#2171095
|
||||
* Tue Dec 07 2021 Pavel Reichl <preichl@redhat.com> - 2.9.9-15
|
||||
- Add gating.yaml file
|
||||
|
||||
* Mon May 30 2022 Pavel Reichl <preichl@redhat.com> - 2.9.7-16
|
||||
- Back-port max_pages support,
|
||||
- caching symlinks in kernel page cache,
|
||||
- and in-kernel readdir caching
|
||||
- Fixed rhbz#2080000
|
||||
* Thu Oct 07 2021 Pavel Reichl <preichl@redhat.com> - 2.9.9-14
|
||||
- Fix failure to build from source, fix wrong URL in Source0
|
||||
Related: rhbz#1984778
|
||||
|
||||
* Wed Feb 23 2022 Pavel Reichl <preichl@redhat.com> - 2.9.7-15
|
||||
- Fix missing dependency of fuse3 on fuse3-libs
|
||||
- Make symlink for mount.fuse to mount.fuse3
|
||||
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.9.9-13
|
||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||
Related: rhbz#1991688
|
||||
|
||||
* Mon Feb 07 2022 Pavel Reichl <preichl@redhat.com> - 2.9.7-14
|
||||
- Fix failing test for fuse-3
|
||||
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 2.9.9-12
|
||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
||||
|
||||
* Mon Jan 31 2022 Pavel Reichl <preichl@redhat.com> - 2.9.7-13
|
||||
- update to 3.3.0
|
||||
- patch #5 is part of fuse-3 upstream now
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.9-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Thu Nov 08 2018 Miklos Szeredi <mszeredi@redhat.com> - 2.9.7-12
|
||||
- Fixed CVE-2018-10906 (rhbz#1607855)
|
||||
- Fix regression from RHEL7 (rhbz#1648280)
|
||||
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.9-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.9-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.9-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Wed May 01 2019 Dave Dykstra <dwd@fedoraproject.org> - 2.9.9-7
|
||||
- Update the Requires: fuse-common >= version to 3.4.2-4 because
|
||||
fuse-common > 3.4.2-3 is insufficient to force the new version
|
||||
|
||||
* Wed May 01 2019 Dave Dykstra <dwd@fedoraproject.org> - 2.9.9-6
|
||||
- Fix name of libfuse.so.2
|
||||
|
||||
* Wed May 01 2019 Dave Dykstra <dwd@fedoraproject.org> - 2.9.9-5
|
||||
- Update the Requires: fuse-common > version to 3.4.2-3
|
||||
|
||||
* Wed May 01 2019 Dave Dykstra <dwd@fedoraproject.org> - 2.9.9-4
|
||||
- Separate fuse3 out into its own package
|
||||
|
||||
* Tue Apr 16 2019 Adam Williamson <awilliam@redhat.com> - 2.9.9-3
|
||||
- Rebuild with Meson fix for #1699099
|
||||
|
||||
* Thu Apr 04 2019 Peter Lemenkov <lemenkov@gmail.com> - 2.9.9-2
|
||||
- Whitelist SMB2 (rhbz#1694552)
|
||||
|
||||
* Mon Mar 25 2019 Tom Callaway <spot@fedoraproject.org> - 2.9.9-1
|
||||
- update fuse to 2.9.9
|
||||
- update fuse3 to 3.4.2
|
||||
|
||||
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.7-17
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Tue Nov 27 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.9.7-16
|
||||
- Rebuild for tinyxml2 7.x
|
||||
|
||||
* Fri Nov 09 2018 Dan Horák <dan[at]danny.cz> - 2.9.7-15
|
||||
- backport buffer-size patch to fuse2
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.7-14
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Mon May 14 2018 Tom Callaway <spot@fedoraproject.org> - 2.9.7-13
|
||||
- update fuse3 to 3.2.3
|
||||
|
||||
* Mon Apr 2 2018 Tom Callaway <spot@fedoraproject.org> - 2.9.7-12
|
||||
- update fuse3 to 3.2.2
|
||||
|
||||
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.7-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
@ -1,19 +1,14 @@
|
||||
From 22ba14e45e84e0bd12a9ab1c9d0460b9ae27c10c Mon Sep 17 00:00:00 2001
|
||||
From: Peter Lemenkov <lemenkov@gmail.com>
|
||||
Date: Mon, 9 Aug 2010 12:10:40 +0400
|
||||
Subject: [PATCH 1/1] More parentheses
|
||||
Subject: [PATCH] More parentheses
|
||||
|
||||
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
|
||||
---
|
||||
lib/fuse.c | 8 +++-----
|
||||
lib/fuse_lowlevel.c | 2 +-
|
||||
2 files changed, 4 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/lib/fuse.c b/lib/fuse.c
|
||||
index d511964..328ebba 100644
|
||||
index d1d873a..ca1709c 100644
|
||||
--- a/lib/fuse.c
|
||||
+++ b/lib/fuse.c
|
||||
@@ -991,17 +991,15 @@ static int fuse_compat_open(struct fuse_fs *fs, const char *path,
|
||||
@@ -1529,17 +1529,15 @@ static int fuse_compat_open(struct fuse_fs *fs, const char *path,
|
||||
{
|
||||
int err;
|
||||
if (!fs->compat || fs->compat >= 25)
|
||||
@ -35,10 +30,10 @@ index d511964..328ebba 100644
|
||||
}
|
||||
|
||||
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
|
||||
index c86a910..4f19d61 100644
|
||||
index ff03c63..255f733 100644
|
||||
--- a/lib/fuse_lowlevel.c
|
||||
+++ b/lib/fuse_lowlevel.c
|
||||
@@ -716,7 +716,7 @@ static void do_open(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
|
||||
@@ -1211,7 +1211,7 @@ static void do_open(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
|
||||
fi.flags = arg->flags;
|
||||
|
||||
if (req->f->op.open)
|
||||
@ -47,6 +42,3 @@ index c86a910..4f19d61 100644
|
||||
else
|
||||
fuse_reply_open(req, &fi);
|
||||
}
|
||||
--
|
||||
1.7.9.3
|
||||
|
@ -0,0 +1,28 @@
|
||||
From: Tom Callaway <spot@fedoraproject.org>
|
||||
Date: Wed, 26 Jun 2013 09:34:52 -0400
|
||||
Subject: [PATCH] add fix for namespace conflict in fuse_kernel.h
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=970768
|
||||
|
||||
diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h
|
||||
index c632b58..9e02fe3 100644
|
||||
--- a/include/fuse_kernel.h
|
||||
+++ b/include/fuse_kernel.h
|
||||
@@ -88,12 +88,16 @@
|
||||
#ifndef _LINUX_FUSE_H
|
||||
#define _LINUX_FUSE_H
|
||||
|
||||
-#include <sys/types.h>
|
||||
+#ifdef __linux__
|
||||
+#include <linux/types.h>
|
||||
+#else
|
||||
+#include <stdint.h>
|
||||
#define __u64 uint64_t
|
||||
#define __s64 int64_t
|
||||
#define __u32 uint32_t
|
||||
#define __s32 int32_t
|
||||
#define __u16 uint16_t
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Version negotiation:
|
@ -1,11 +1,6 @@
|
||||
From a83b3ec1d7ce2d656a4c476d65486371d1a659b2 Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Maiolino <cmaiolino@redhat.com>
|
||||
Date: Tue, 2 May 2017 12:46:10 +0200
|
||||
Subject: [PATCH] From 4f8f034a8969a48f210bf00be78a67cfb6964c72 Mon Sep 17
|
||||
00:00:00 2001 From: Carlos Maiolino
|
||||
<cmaiolino-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Date: Thu, 20 Apr 2017
|
||||
14:53:01 +0200 Subject: [PATCH] make buffer size match kernel max transfer
|
||||
size
|
||||
From: Carlos Maiolino <cmaiolino-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
|
||||
Date: Thu, 20 Apr 2017 14:53:01 +0200
|
||||
Subject: [PATCH] make buffer size match kernel max transfer size
|
||||
|
||||
Currently libfuse has a hardcoded buffer limit to 128kib, while fuse
|
||||
kernel module has a limit up to 32 pages.
|
||||
@ -19,16 +14,12 @@ accommodate the header, making it easier to understand why those extra
|
||||
4096 bytes are needed
|
||||
|
||||
Signed-off-by: Carlos Maiolino <cmaiolino-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
|
||||
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
|
||||
---
|
||||
lib/fuse_kern_chan.c | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/fuse_kern_chan.c b/lib/fuse_kern_chan.c
|
||||
index 5f77bbf..4cc9b73 100644
|
||||
index 4a9beb8..640b91a 100644
|
||||
--- a/lib/fuse_kern_chan.c
|
||||
+++ b/lib/fuse_kern_chan.c
|
||||
@@ -80,7 +80,10 @@ static void fuse_kern_chan_destroy(struct fuse_chan *ch)
|
||||
@@ -83,7 +83,10 @@ static void fuse_kern_chan_destroy(struct fuse_chan *ch)
|
||||
close(fd);
|
||||
}
|
||||
|
||||
@ -40,7 +31,7 @@ index 5f77bbf..4cc9b73 100644
|
||||
|
||||
struct fuse_chan *fuse_kern_chan_new(int fd)
|
||||
{
|
||||
@@ -89,7 +92,6 @@ struct fuse_chan *fuse_kern_chan_new(int fd)
|
||||
@@ -92,7 +95,6 @@ struct fuse_chan *fuse_kern_chan_new(int fd)
|
||||
.send = fuse_kern_chan_send,
|
||||
.destroy = fuse_kern_chan_destroy,
|
||||
};
|
||||
@ -49,6 +40,3 @@ index 5f77bbf..4cc9b73 100644
|
||||
+ size_t bufsize = KERNEL_BUF_PAGES * getpagesize() + HEADER_SIZE;
|
||||
return fuse_chan_new(&op, fd, bufsize, NULL);
|
||||
}
|
||||
--
|
||||
2.9.3
|
||||
|
20
fuse2-0004-Whitelist-SMB2-found-on-some-NAS-devices.patch
Normal file
20
fuse2-0004-Whitelist-SMB2-found-on-some-NAS-devices.patch
Normal file
@ -0,0 +1,20 @@
|
||||
From: Peter Lemenkov <lemenkov@gmail.com>
|
||||
Date: Wed, 3 Apr 2019 12:23:56 +0300
|
||||
Subject: [PATCH] Whitelist SMB2 found on some NAS devices
|
||||
|
||||
* https://bugzilla.redhat.com/1694552#c7
|
||||
|
||||
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
|
||||
|
||||
diff --git a/util/fusermount.c b/util/fusermount.c
|
||||
index 4b799d9..ef9d1ed 100644
|
||||
--- a/util/fusermount.c
|
||||
+++ b/util/fusermount.c
|
||||
@@ -1046,6 +1046,7 @@ static int check_perm(const char **mntp, struct stat *stbuf, int *mountpoint_fd)
|
||||
0x5346544E /* NTFS_SB_MAGIC */,
|
||||
0x794C7630 /* OVERLAYFS_SUPER_MAGIC */,
|
||||
0x52654973 /* REISERFS_SUPER_MAGIC */,
|
||||
+ 0xFE534D42 /* SMB2_SUPER_MAGIC */,
|
||||
0x73717368 /* SQUASHFS_MAGIC */,
|
||||
0x01021994 /* TMPFS_MAGIC */,
|
||||
0x24051905 /* UBIFS_SUPER_MAGIC */,
|
60
fuse2-0005-remove-closefrom-function.patch
Normal file
60
fuse2-0005-remove-closefrom-function.patch
Normal file
@ -0,0 +1,60 @@
|
||||
From ae2352bca9b4e607538412da0cc2a9625cd8b692 Mon Sep 17 00:00:00 2001
|
||||
From: Sam James <sam@gentoo.org>
|
||||
Date: Sat, 24 Jul 2021 22:02:45 +0100
|
||||
Subject: [PATCH] util/ulockmgr_server.c: conditionally define closefrom (fix
|
||||
glibc-2.34+)
|
||||
|
||||
closefrom(3) has joined us in glibc-land from *BSD and Solaris. Since
|
||||
it's available in glibc 2.34+, we want to detect it and only define our
|
||||
fallback if the libc doesn't provide it.
|
||||
|
||||
Bug: https://bugs.gentoo.org/803923
|
||||
Signed-off-by: Sam James <sam@gentoo.org>
|
||||
---
|
||||
configure.ac | 1 +
|
||||
util/ulockmgr_server.c | 6 ++++++
|
||||
2 files changed, 7 insertions(+)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 9946a0efa..a2d481aa9 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -55,6 +55,7 @@ fi
|
||||
|
||||
AC_CHECK_FUNCS([fork setxattr fdatasync splice vmsplice utimensat])
|
||||
AC_CHECK_FUNCS([posix_fallocate])
|
||||
+AC_CHECK_FUNCS([closefrom])
|
||||
AC_CHECK_MEMBERS([struct stat.st_atim])
|
||||
AC_CHECK_MEMBERS([struct stat.st_atimespec])
|
||||
|
||||
diff --git a/util/ulockmgr_server.c b/util/ulockmgr_server.c
|
||||
index 273c7d923..a04dac5c6 100644
|
||||
--- a/util/ulockmgr_server.c
|
||||
+++ b/util/ulockmgr_server.c
|
||||
@@ -22,6 +22,10 @@
|
||||
#include <sys/socket.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+ #include "config.h"
|
||||
+#endif
|
||||
+
|
||||
struct message {
|
||||
unsigned intr : 1;
|
||||
unsigned nofd : 1;
|
||||
@@ -124,6 +128,7 @@ static int receive_message(int sock, void *buf, size_t buflen, int *fdp,
|
||||
return res;
|
||||
}
|
||||
|
||||
+#if !defined(HAVE_CLOSEFROM)
|
||||
static int closefrom(int minfd)
|
||||
{
|
||||
DIR *dir = opendir("/proc/self/fd");
|
||||
@@ -141,6 +146,7 @@ static int closefrom(int minfd)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
+#endif
|
||||
|
||||
static void send_reply(int cfd, struct message *msg)
|
||||
{
|
@ -0,0 +1,35 @@
|
||||
From 29f621af8d39d5a140da584ff6c1eb00147b5a56 Mon Sep 17 00:00:00 2001
|
||||
From: Miklos Szeredi <mszeredi@redhat.com>
|
||||
Date: Thu, 13 Jun 2024 13:57:25 +0200
|
||||
Subject: [PATCH] libfuse: null-terminate buffer in fuse_req_getgroups()
|
||||
|
||||
After reading the file /proc/$PID/task/$PID/status the buffer wasn't
|
||||
terminated with a null character. This could theoretically lead to buffer
|
||||
overrun by the subsequent strstr() call.
|
||||
|
||||
Since the contents of the proc file are guaranteed to contain the pattern
|
||||
that strstr is looking for, this doesn't happen in normal situations.
|
||||
|
||||
Add null termination for robustness.
|
||||
|
||||
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
|
||||
Signed-off-by: Pavel Reichl <preichl@redhat.com>
|
||||
---
|
||||
lib/fuse_lowlevel.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
|
||||
index fc46882..74b0424 100644
|
||||
--- a/lib/fuse_lowlevel.c
|
||||
+++ b/lib/fuse_lowlevel.c
|
||||
@@ -3353,6 +3353,7 @@ retry:
|
||||
goto retry;
|
||||
}
|
||||
|
||||
+ buf[ret] = '\0';
|
||||
ret = -EIO;
|
||||
s = strstr(buf, "\nGroups:");
|
||||
if (s == NULL)
|
||||
--
|
||||
2.45.2
|
||||
|
5
gating.yaml
Normal file
5
gating.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
--- !Policy
|
||||
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
8
plan.fmf
Normal file
8
plan.fmf
Normal file
@ -0,0 +1,8 @@
|
||||
summary: fuse gating test
|
||||
execute:
|
||||
how: tmt
|
||||
discover:
|
||||
how: fmf
|
||||
test: [
|
||||
"fuse-sanity-test",
|
||||
]
|
1
sources
Normal file
1
sources
Normal file
@ -0,0 +1 @@
|
||||
SHA512 (fuse-2.9.9.tar.gz) = 3d82fafd04f2924299bb09d2bb144935fa004a43fb9a6568e2e1cc5a60fded2efa1711029a0d7f12b3e6e4501f7217f2ee3545646d89da8dece083cb390f23e2
|
70
tests/fuse-sanity-test/Makefile
Normal file
70
tests/fuse-sanity-test/Makefile
Normal file
@ -0,0 +1,70 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /kernel/filesystems/fuse/gating/fuse2
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2022 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Author and description of the test
|
||||
AUTHOR=Zorro Lang <zlang@redhat.com>
|
||||
DESCRIPTION=The gating test case of fuse-2.x
|
||||
|
||||
# The name of the test.
|
||||
export TEST=/kernel/filesystems/fuse/gating/fuse2
|
||||
|
||||
# Version of the test. Used with make tag.
|
||||
export TESTVERSION=1.0
|
||||
|
||||
# data files, .c files, scripts anything needed to either compile the test and/or run it.
|
||||
FILES=$(METADATA) runtest.sh PURPOSE fusexmp_fh.c fusetest.c
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES) $(FILES)
|
||||
chmod a+x ./runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~
|
||||
|
||||
# Include Common Makefile
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
# Generate the testinfo.desc here:
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: $(AUTHOR)" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Description: $(DESCRIPTION)" >> $(METADATA)
|
||||
@echo "TestTime: 12h" >> $(METADATA)
|
||||
@echo "RunFor: fuse" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "Requires: fuse" >> $(METADATA)
|
||||
@echo "Requires: fuse-devel" >> $(METADATA)
|
||||
@echo "Requires: fuse-libs" >> $(METADATA)
|
||||
@echo "Requires: pkgconf-pkg-config" >> $(METADATA)
|
||||
@echo "Requires: gcc" >> $(METADATA)
|
||||
@echo "Requires: glibc-headers" >> $(METADATA)
|
||||
@echo "Requires: procps-ng" >> $(METADATA)
|
||||
rhts-lint $(METADATA)
|
||||
# The include package trys to install all the potential dependencies.
|
||||
# Not each them are available on all RHEL old/new systems.
|
3
tests/fuse-sanity-test/PURPOSE
Normal file
3
tests/fuse-sanity-test/PURPOSE
Normal file
@ -0,0 +1,3 @@
|
||||
Description:
|
||||
|
||||
This's a simple gating test case for fuse-2.x.
|
1492
tests/fuse-sanity-test/fusetest.c
Normal file
1492
tests/fuse-sanity-test/fusetest.c
Normal file
File diff suppressed because it is too large
Load Diff
539
tests/fuse-sanity-test/fusexmp_fh.c
Normal file
539
tests/fuse-sanity-test/fusexmp_fh.c
Normal file
@ -0,0 +1,539 @@
|
||||
/*
|
||||
Copy from upstream libfuse/example/fusexmp_fh.c, then make some
|
||||
local changes.
|
||||
|
||||
gcc -Wall fusexmp_fh.c `pkg-config fuse --cflags --libs` -lulockmgr -o fusexmp_fh
|
||||
*/
|
||||
|
||||
#define FUSE_USE_VERSION 26
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <fuse.h>
|
||||
#include <ulockmgr.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/xattr.h>
|
||||
#include <sys/file.h> /* flock(2) */
|
||||
|
||||
static int xmp_getattr(const char *path, struct stat *stbuf)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = lstat(path, stbuf);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_fgetattr(const char *path, struct stat *stbuf,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
int res;
|
||||
|
||||
(void) path;
|
||||
|
||||
res = fstat(fi->fh, stbuf);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_access(const char *path, int mask)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = access(path, mask);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_readlink(const char *path, char *buf, size_t size)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = readlink(path, buf, size - 1);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
buf[res] = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct xmp_dirp {
|
||||
DIR *dp;
|
||||
struct dirent *entry;
|
||||
off_t offset;
|
||||
};
|
||||
|
||||
static int xmp_opendir(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
int res;
|
||||
struct xmp_dirp *d = malloc(sizeof(struct xmp_dirp));
|
||||
if (d == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
d->dp = opendir(path);
|
||||
if (d->dp == NULL) {
|
||||
res = -errno;
|
||||
free(d);
|
||||
return res;
|
||||
}
|
||||
d->offset = 0;
|
||||
d->entry = NULL;
|
||||
|
||||
fi->fh = (unsigned long) d;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline struct xmp_dirp *get_dirp(struct fuse_file_info *fi)
|
||||
{
|
||||
return (struct xmp_dirp *) (uintptr_t) fi->fh;
|
||||
}
|
||||
|
||||
static int xmp_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
|
||||
off_t offset, struct fuse_file_info *fi)
|
||||
{
|
||||
struct xmp_dirp *d = get_dirp(fi);
|
||||
|
||||
(void) path;
|
||||
if (offset != d->offset) {
|
||||
seekdir(d->dp, offset);
|
||||
d->entry = NULL;
|
||||
d->offset = offset;
|
||||
}
|
||||
while (1) {
|
||||
struct stat st;
|
||||
off_t nextoff;
|
||||
|
||||
if (!d->entry) {
|
||||
d->entry = readdir(d->dp);
|
||||
if (!d->entry)
|
||||
break;
|
||||
}
|
||||
|
||||
memset(&st, 0, sizeof(st));
|
||||
st.st_ino = d->entry->d_ino;
|
||||
st.st_mode = d->entry->d_type << 12;
|
||||
nextoff = telldir(d->dp);
|
||||
if (filler(buf, d->entry->d_name, &st, nextoff))
|
||||
break;
|
||||
|
||||
d->entry = NULL;
|
||||
d->offset = nextoff;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_releasedir(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
struct xmp_dirp *d = get_dirp(fi);
|
||||
(void) path;
|
||||
closedir(d->dp);
|
||||
free(d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_mknod(const char *path, mode_t mode, dev_t rdev)
|
||||
{
|
||||
int res;
|
||||
|
||||
if (S_ISFIFO(mode))
|
||||
res = mkfifo(path, mode);
|
||||
else
|
||||
res = mknod(path, mode, rdev);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_mkdir(const char *path, mode_t mode)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = mkdir(path, mode);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_unlink(const char *path)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = unlink(path);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_rmdir(const char *path)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = rmdir(path);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_symlink(const char *from, const char *to)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = symlink(from, to);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_rename(const char *from, const char *to)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = rename(from, to);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_link(const char *from, const char *to)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = link(from, to);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_chmod(const char *path, mode_t mode)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = chmod(path, mode);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_chown(const char *path, uid_t uid, gid_t gid)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = lchown(path, uid, gid);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_truncate(const char *path, off_t size)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = truncate(path, size);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_ftruncate(const char *path, off_t size,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
int res;
|
||||
|
||||
(void) path;
|
||||
|
||||
res = ftruncate(fi->fh, size);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_utimens(const char *path, const struct timespec ts[2])
|
||||
{
|
||||
int res;
|
||||
|
||||
/* don't use utime/utimes since they follow symlinks */
|
||||
res = utimensat(0, path, ts, AT_SYMLINK_NOFOLLOW);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_create(const char *path, mode_t mode, struct fuse_file_info *fi)
|
||||
{
|
||||
int fd;
|
||||
|
||||
fd = open(path, fi->flags, mode);
|
||||
if (fd == -1)
|
||||
return -errno;
|
||||
|
||||
fi->fh = fd;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_open(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
int fd;
|
||||
|
||||
fd = open(path, fi->flags);
|
||||
if (fd == -1)
|
||||
return -errno;
|
||||
|
||||
fi->fh = fd;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_read(const char *path, char *buf, size_t size, off_t offset,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
int res;
|
||||
|
||||
(void) path;
|
||||
res = pread(fi->fh, buf, size, offset);
|
||||
if (res == -1)
|
||||
res = -errno;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static int xmp_read_buf(const char *path, struct fuse_bufvec **bufp,
|
||||
size_t size, off_t offset, struct fuse_file_info *fi)
|
||||
{
|
||||
struct fuse_bufvec *src;
|
||||
|
||||
(void) path;
|
||||
|
||||
src = malloc(sizeof(struct fuse_bufvec));
|
||||
if (src == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
*src = FUSE_BUFVEC_INIT(size);
|
||||
|
||||
src->buf[0].flags = FUSE_BUF_IS_FD | FUSE_BUF_FD_SEEK;
|
||||
src->buf[0].fd = fi->fh;
|
||||
src->buf[0].pos = offset;
|
||||
|
||||
*bufp = src;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_write(const char *path, const char *buf, size_t size,
|
||||
off_t offset, struct fuse_file_info *fi)
|
||||
{
|
||||
int res;
|
||||
|
||||
(void) path;
|
||||
res = pwrite(fi->fh, buf, size, offset);
|
||||
if (res == -1)
|
||||
res = -errno;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static int xmp_write_buf(const char *path, struct fuse_bufvec *buf,
|
||||
off_t offset, struct fuse_file_info *fi)
|
||||
{
|
||||
struct fuse_bufvec dst = FUSE_BUFVEC_INIT(fuse_buf_size(buf));
|
||||
|
||||
(void) path;
|
||||
|
||||
dst.buf[0].flags = FUSE_BUF_IS_FD | FUSE_BUF_FD_SEEK;
|
||||
dst.buf[0].fd = fi->fh;
|
||||
dst.buf[0].pos = offset;
|
||||
|
||||
return fuse_buf_copy(&dst, buf, FUSE_BUF_SPLICE_NONBLOCK);
|
||||
}
|
||||
|
||||
static int xmp_statfs(const char *path, struct statvfs *stbuf)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = statvfs(path, stbuf);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_flush(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
int res;
|
||||
|
||||
(void) path;
|
||||
/* This is called from every close on an open file, so call the
|
||||
close on the underlying filesystem. But since flush may be
|
||||
called multiple times for an open file, this must not really
|
||||
close the file. This is important if used on a network
|
||||
filesystem like NFS which flush the data/metadata on close() */
|
||||
res = close(dup(fi->fh));
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_release(const char *path, struct fuse_file_info *fi)
|
||||
{
|
||||
(void) path;
|
||||
close(fi->fh);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_fsync(const char *path, int isdatasync,
|
||||
struct fuse_file_info *fi)
|
||||
{
|
||||
int res;
|
||||
(void) path;
|
||||
|
||||
if (isdatasync)
|
||||
res = fdatasync(fi->fh);
|
||||
else
|
||||
res = fsync(fi->fh);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_fallocate(const char *path, int mode,
|
||||
off_t offset, off_t length, struct fuse_file_info *fi)
|
||||
{
|
||||
(void) path;
|
||||
|
||||
if (mode)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
return -posix_fallocate(fi->fh, offset, length);
|
||||
}
|
||||
|
||||
/* xattr operations are optional and can safely be left unimplemented */
|
||||
static int xmp_setxattr(const char *path, const char *name, const char *value,
|
||||
size_t size, int flags)
|
||||
{
|
||||
int res = lsetxattr(path, name, value, size, flags);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_getxattr(const char *path, const char *name, char *value,
|
||||
size_t size)
|
||||
{
|
||||
int res = lgetxattr(path, name, value, size);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
return res;
|
||||
}
|
||||
|
||||
static int xmp_listxattr(const char *path, char *list, size_t size)
|
||||
{
|
||||
int res = llistxattr(path, list, size);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
return res;
|
||||
}
|
||||
|
||||
static int xmp_removexattr(const char *path, const char *name)
|
||||
{
|
||||
int res = lremovexattr(path, name);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xmp_lock(const char *path, struct fuse_file_info *fi, int cmd,
|
||||
struct flock *lock)
|
||||
{
|
||||
(void) path;
|
||||
|
||||
return ulockmgr_op(fi->fh, cmd, lock, &fi->lock_owner,
|
||||
sizeof(fi->lock_owner));
|
||||
}
|
||||
|
||||
static int xmp_flock(const char *path, struct fuse_file_info *fi, int op)
|
||||
{
|
||||
int res;
|
||||
(void) path;
|
||||
|
||||
res = flock(fi->fh, op);
|
||||
if (res == -1)
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct fuse_operations xmp_oper = {
|
||||
.getattr = xmp_getattr,
|
||||
.fgetattr = xmp_fgetattr,
|
||||
.access = xmp_access,
|
||||
.readlink = xmp_readlink,
|
||||
.opendir = xmp_opendir,
|
||||
.readdir = xmp_readdir,
|
||||
.releasedir = xmp_releasedir,
|
||||
.mknod = xmp_mknod,
|
||||
.mkdir = xmp_mkdir,
|
||||
.symlink = xmp_symlink,
|
||||
.unlink = xmp_unlink,
|
||||
.rmdir = xmp_rmdir,
|
||||
.rename = xmp_rename,
|
||||
.link = xmp_link,
|
||||
.chmod = xmp_chmod,
|
||||
.chown = xmp_chown,
|
||||
.truncate = xmp_truncate,
|
||||
.ftruncate = xmp_ftruncate,
|
||||
.utimens = xmp_utimens,
|
||||
.create = xmp_create,
|
||||
.open = xmp_open,
|
||||
.read = xmp_read,
|
||||
.read_buf = xmp_read_buf,
|
||||
.write = xmp_write,
|
||||
.write_buf = xmp_write_buf,
|
||||
.statfs = xmp_statfs,
|
||||
.flush = xmp_flush,
|
||||
.release = xmp_release,
|
||||
.fsync = xmp_fsync,
|
||||
.fallocate = xmp_fallocate,
|
||||
.setxattr = xmp_setxattr,
|
||||
.getxattr = xmp_getxattr,
|
||||
.listxattr = xmp_listxattr,
|
||||
.removexattr = xmp_removexattr,
|
||||
.lock = xmp_lock,
|
||||
.flock = xmp_flock,
|
||||
|
||||
.flag_nullpath_ok = 1,
|
||||
.flag_utime_omit_ok = 1,
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
umask(0);
|
||||
return fuse_main(argc, argv, &xmp_oper, NULL);
|
||||
}
|
17
tests/fuse-sanity-test/main.fmf
Normal file
17
tests/fuse-sanity-test/main.fmf
Normal file
@ -0,0 +1,17 @@
|
||||
summary: The gating test case of fuse-2.x
|
||||
description: This's a simple gating test case for fuse-2.x.
|
||||
contact: Zorro Lang <zlang@redhat.com>
|
||||
component:
|
||||
- fuse
|
||||
test: ./runtest.sh
|
||||
framework: shell
|
||||
recommend:
|
||||
- fuse
|
||||
- fuse-devel
|
||||
- fuse-libs
|
||||
- pkgconf-pkg-config
|
||||
- gcc
|
||||
- glibc-headers
|
||||
- procps-ng
|
||||
- beakerlib
|
||||
duration: 12h
|
136
tests/fuse-sanity-test/runtest.sh
Executable file
136
tests/fuse-sanity-test/runtest.sh
Executable file
@ -0,0 +1,136 @@
|
||||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Description: Run for fuse-2.x CI gating test
|
||||
# Author: Zorro Lang <zlang@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2022 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
TEST_DIR=/mnt/fuse2-gating
|
||||
|
||||
status=1
|
||||
trap "cleanup;" 0 1 2 3 9 15
|
||||
|
||||
# test exits here
|
||||
cleanup()
|
||||
{
|
||||
pkill fusetest
|
||||
umount $TEST_DIR
|
||||
pkill fusexmp_fh 2>/dev/null
|
||||
if [ $status -eq 0 ];then
|
||||
_report "CLEAN" PASS
|
||||
else
|
||||
_report "CLEAN" FAIL
|
||||
fi
|
||||
exit $status
|
||||
}
|
||||
|
||||
if [ -z "$RECIPEID" -o -z "$TASKID" ]; then
|
||||
OUTPUTFILE=`pwd`/output.log
|
||||
echo "No RECIPEID or TASKID, maybe local manual test" | tee $OUTPUTFILE
|
||||
fi
|
||||
|
||||
function echoo()
|
||||
{
|
||||
echo $@ | tee -a $OUTPUTFILE
|
||||
}
|
||||
|
||||
# Wrapper to log the output of the command
|
||||
function xlog()
|
||||
{
|
||||
echoo "$@"
|
||||
$@ 2>&1 | tee -a $OUTPUTFILE
|
||||
return $?
|
||||
}
|
||||
|
||||
# Wrapper to report_result, clears $OUTPUTFILE
|
||||
function _report()
|
||||
{
|
||||
local what="$FSTYP:$1"
|
||||
local status="$2"
|
||||
local score="$3"
|
||||
test -z "$score" && score=0
|
||||
echoo "---------------------------------------------"
|
||||
echoo -e "|Report:\t" "$what\t" "$status\t" "$score|"
|
||||
echoo "---------------------------------------------"
|
||||
rhts-report-result "$what" "$status" "$OUTPUTFILE" "$score"
|
||||
if [ -f "$OUTPUTFILE" ];then
|
||||
rm -f $OUTPUTFILE
|
||||
touch $OUTPUTFILE
|
||||
fi
|
||||
}
|
||||
|
||||
function prepare_test()
|
||||
{
|
||||
yum --enablerepo=* -y --nogpgcheck --setopt=skip_if_unavailable=True install fuse fuse-libs fuse-devel \
|
||||
pkgconf-pkg-config gcc glibc-headers procps-ng
|
||||
if [ $? -ne 0 ];then
|
||||
_report prepare_test FAIL
|
||||
exit 1
|
||||
fi
|
||||
|
||||
_report prepare_test PASS
|
||||
}
|
||||
|
||||
function build_test()
|
||||
{
|
||||
xlog gcc -Wall fusexmp_fh.c `pkg-config fuse --cflags --libs` -lulockmgr -o fusexmp_fh
|
||||
if [ $? -ne 0 ];then
|
||||
_report build_test:fusexmp_fh FAIL
|
||||
exit 1
|
||||
fi
|
||||
xlog gcc -Wall fusetest.c -o fusetest
|
||||
if [ $? -ne 0 ];then
|
||||
_report build_test:fusetest FAIL
|
||||
exit 1
|
||||
fi
|
||||
|
||||
_report build_test PASS
|
||||
}
|
||||
|
||||
function do_test()
|
||||
{
|
||||
mkdir -p $TEST_DIR 2>/dev/null
|
||||
if [ ! -d $TEST_DIR ];then
|
||||
_report do_test:TEST_DIR_missing FAIL
|
||||
exit 1
|
||||
fi
|
||||
xlog ./fusexmp_fh $TEST_DIR
|
||||
if [ $? -ne 0 ] || (! findmnt $TEST_DIR >/dev/null 2>&1 );then
|
||||
_report do_test:mount FAIL
|
||||
exit 1
|
||||
fi
|
||||
|
||||
xlog ./fusetest $TEST_DIR
|
||||
if [ $? -eq 0 ];then
|
||||
_report do_test:fusetest PASS
|
||||
else
|
||||
_report do_test:fusetest FAIL
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
prepare_test
|
||||
build_test
|
||||
do_test
|
||||
status=0
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user