Bug 236560 - [FUSEFS] fuse(4) ignores FOPEN_KEEP_CACHE
Summary: [FUSEFS] fuse(4) ignores FOPEN_KEEP_CACHE
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Alan Somers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-15 22:42 UTC by Alan Somers
Modified: 2019-03-21 20:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer 2019-03-15 22:42:00 UTC
If a fuse filesystem sets FOPEN_KEEP_CACHE in the response to FUSE_OPEN, then the kernel should not flush its read caches on subsequent open(2)s of the same file.  Our fuse(4) driver does indeed check for that flag in fuse_vnode_open.  However, the check doesn't work, because the flag isn't saved from the previous FUSE_OPEN.  The flag is guaranteed to be unset in that code path.  The solution would be to save the open_flags in the vnode.
Comment 1 commit-hook freebsd_committer 2019-03-15 22:48:25 UTC
A commit references this bug:

Author: asomers
Date: Fri Mar 15 22:47:26 UTC 2019
New revision: 345207
URL: https://svnweb.freebsd.org/changeset/base/345207

Log:
  fuse(4): add tests for the FOPEN_KEEP_CACHE option

  PR:		236560
  Sponsored by:	The FreeBSD Foundation

Changes:
  projects/fuse2/tests/sys/fs/fuse/access.cc
  projects/fuse2/tests/sys/fs/fuse/create.cc
  projects/fuse2/tests/sys/fs/fuse/destroy.cc
  projects/fuse2/tests/sys/fs/fuse/flush.cc
  projects/fuse2/tests/sys/fs/fuse/fsync.cc
  projects/fuse2/tests/sys/fs/fuse/fsyncdir.cc
  projects/fuse2/tests/sys/fs/fuse/getattr.cc
  projects/fuse2/tests/sys/fs/fuse/interrupt.cc
  projects/fuse2/tests/sys/fs/fuse/link.cc
  projects/fuse2/tests/sys/fs/fuse/locks.cc
  projects/fuse2/tests/sys/fs/fuse/mkdir.cc
  projects/fuse2/tests/sys/fs/fuse/open.cc
  projects/fuse2/tests/sys/fs/fuse/opendir.cc
  projects/fuse2/tests/sys/fs/fuse/read.cc
  projects/fuse2/tests/sys/fs/fuse/readdir.cc
  projects/fuse2/tests/sys/fs/fuse/readlink.cc
  projects/fuse2/tests/sys/fs/fuse/release.cc
  projects/fuse2/tests/sys/fs/fuse/releasedir.cc
  projects/fuse2/tests/sys/fs/fuse/rename.cc
  projects/fuse2/tests/sys/fs/fuse/unlink.cc
  projects/fuse2/tests/sys/fs/fuse/utils.cc
  projects/fuse2/tests/sys/fs/fuse/utils.hh
  projects/fuse2/tests/sys/fs/fuse/write.cc
  projects/fuse2/tests/sys/fs/fuse/xattr.cc