diff options
author | Alan Somers <asomers@FreeBSD.org> | 2019-04-12 00:15:36 +0000 |
---|---|---|
committer | Alan Somers <asomers@FreeBSD.org> | 2019-04-12 00:15:36 +0000 |
commit | 1f4a83f981fb15213f8ee59a3bdfd0e4dbc4c2e6 (patch) | |
tree | 86351abd353cdaa3459f061bcb0fb0382fff71c4 /sys/fs/fuse/fuse_internal.c | |
parent | b349700a04c30d41cc896de1a5ea8b3b3e9affaf (diff) | |
download | src-1f4a83f981fb15213f8ee59a3bdfd0e4dbc4c2e6.tar.gz src-1f4a83f981fb15213f8ee59a3bdfd0e4dbc4c2e6.zip |
fusefs: Handle ENOSYS for all remaining opcodes
For many FUSE opcodes, an error of ENOSYS has special meaning. fusefs
already handled some of those; this commit adds handling for the remainder:
* FUSE_FSYNC, FUSE_FSYNCDIR: ENOSYS means "success, and automatically return
success without calling the daemon from now on"
* All extattr operations: ENOSYS means "fail EOPNOTSUPP, and automatically
do it without calling the daemon from now on"
PR: 236557
Sponsored by: The FreeBSD Foundation
Notes
Notes:
svn path=/projects/fuse2/; revision=346141
Diffstat (limited to 'sys/fs/fuse/fuse_internal.c')
-rw-r--r-- | sys/fs/fuse/fuse_internal.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index f30e8fe17681..935d049f3ba3 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -259,6 +259,7 @@ fuse_internal_fsync(struct vnode *vp, struct fuse_dispatcher fdi; struct fuse_filehandle *fufh; struct fuse_vnode_data *fvdat = VTOFUD(vp); + struct mount *mp = vnode_mount(vp); int op = FUSE_FSYNC; int err = 0; @@ -269,6 +270,9 @@ fuse_internal_fsync(struct vnode *vp, if (vnode_isdir(vp)) op = FUSE_FSYNCDIR; + if (!fsess_isimpl(mp, op)) + return 0; + fdisp_init(&fdi, sizeof(*ffsi)); /* * fsync every open file handle for this file, because we can't be sure @@ -293,6 +297,12 @@ fuse_internal_fsync(struct vnode *vp, fuse_internal_fsync_callback); fuse_insert_message(fdi.tick); } + if (err == ENOSYS) { + /* ENOSYS means "success, and don't call again" */ + fsess_set_notimpl(mp, op); + err = 0; + break; + } } fdisp_destroy(&fdi); |