diff options
author | CismonX <admin@cismon.net> | 2024-11-02 20:19:15 +0000 |
---|---|---|
committer | Alan Somers <asomers@FreeBSD.org> | 2025-01-20 22:34:18 +0000 |
commit | 039609b04d63f2e597d70fec66915a766834e81c (patch) | |
tree | cfa29d523f0047670d81d2dfa75f19d1967030fb /sys/fs/fuse/fuse_file.c | |
parent | 4ded81daacec72e16da6cdb64bde8edd4a8fe0e4 (diff) |
fusefs: ignore FUSE_NO_OPEN(DIR)_SUPPORT flags
The FUSE_NO_OPEN_SUPPORT and FUSE_NO_OPENDIR_SUPPORT flags
are only meant to indicate kernel features, and should be ignored
if they appear in the FUSE_INIT reply flags.
Also fix the corresponding test cases.
Reviewed by: Alan Somers <asomers@FreeBSD.org>
Signed-off-by: CismonX <admin@cismon.net>
Pull Request: https://github.com/freebsd/freebsd-src/pull/1509
(cherry picked from commit f0f596bd955e5b48c55db502e79fc652ac8970d3)
Diffstat (limited to 'sys/fs/fuse/fuse_file.c')
-rw-r--r-- | sys/fs/fuse/fuse_file.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/fs/fuse/fuse_file.c b/sys/fs/fuse/fuse_file.c index ecaa641a9261..22fc283e263c 100644 --- a/sys/fs/fuse/fuse_file.c +++ b/sys/fs/fuse/fuse_file.c @@ -123,7 +123,6 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, struct fuse_filehandle **fufhp, struct thread *td, struct ucred *cred) { struct mount *mp = vnode_mount(vp); - struct fuse_data *data = fuse_get_mpdata(mp); struct fuse_dispatcher fdi; const struct fuse_open_out default_foo = { .fh = 0, @@ -133,12 +132,10 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, struct fuse_open_in *foi = NULL; const struct fuse_open_out *foo; fufh_type_t fufh_type; - int dataflags = data->dataflags; int err = 0; int oflags = 0; int op = FUSE_OPEN; int relop = FUSE_RELEASE; - int fsess_no_op_support = FSESS_NO_OPEN_SUPPORT; fufh_type = fflags_2_fufh_type(a_mode); oflags = fufh_type_2_fflags(fufh_type); @@ -146,12 +143,11 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, if (vnode_isdir(vp)) { op = FUSE_OPENDIR; relop = FUSE_RELEASEDIR; - fsess_no_op_support = FSESS_NO_OPENDIR_SUPPORT; /* vn_open_vnode already rejects FWRITE on directories */ MPASS(fufh_type == FUFH_RDONLY || fufh_type == FUFH_EXEC); } fdisp_init(&fdi, sizeof(*foi)); - if (fsess_not_impl(mp, op) && dataflags & fsess_no_op_support) { + if (fsess_not_impl(mp, op)) { /* The operation implicitly succeeds */ foo = &default_foo; } else { @@ -161,7 +157,7 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, foi->flags = oflags; err = fdisp_wait_answ(&fdi); - if (err == ENOSYS && dataflags & fsess_no_op_support) { + if (err == ENOSYS) { /* The operation implicitly succeeds */ foo = &default_foo; fsess_set_notimpl(mp, op); @@ -175,6 +171,7 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, goto out; } else { foo = fdi.answ; + fsess_set_impl(mp, op); } } |