1. 09 Oct, 2018 1 commit
  2. 08 Oct, 2018 3 commits
    • Jakob Unterwurzacher's avatar
      pathfs: fix possible nil pointer dereference in GetAttr · 47211c2b
      Jakob Unterwurzacher authored
      gocryptfs user Felix Lechner reported a nil pointer dereference
      in GetAttr: https://github.com/rfjakob/gocryptfs/issues/260
      
      The crash is in line
      
      	n.setClientInode(fi.Ino)
      
      because fi is nil.
      
      This can happen when file.GetAttr() returns an error code other than
      ENOSYS and EBADF. For gocryptfs, this can only happen when an open
      file descriptor breaks. In this case it was triggered by a failing
      NFS volume.
      
      Fix the crash by erroring out for error codes that are not handled
      by the retry-by-path logic.
      47211c2b
    • Kirill Smelkov's avatar
      fuse: A bit better package documentation rendering in godoc · f4f7205f
      Kirill Smelkov authored
      Current state is: fuse's godoc package-level description is completely
      empty because there is a blank link between package-level description
      and package clause.
      
      Yes, a user still has to go through api.go and read it in full, but
      having at least something for the description is a better start, and
      removing one line is easy.
      
      We already do it this way e.g. for nodefs and in other places.
      f4f7205f
    • Kirill Smelkov's avatar
      Add support for store notify · bdca0e6a
      Kirill Smelkov authored
      I'm writing a networked filesystem which reads data in 2MB blocks from
      remote database. However read requests from the kernel come in much
      smaller sizes - for example 4K-128K.
      
      Since it would be very slow to refetch the 2MB block for e.g. every
      consecutive 4K reads, a cache for fetched data is needed. A custom cache
      would do, however since the kernel already implements pagecache to cache
      file data, it is logical to use it directly.
      
      FUSE protocol provides primitives for pagecache control. We already have
      support for e.g. invalidating a data region for inode (InodeNotify), but
      there is more there. In particular it is possible to store and
      retrieve data into/from the kernel cache with "store notify" and
      "retrieve notify" messages:
      
      https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/fuse.h?id=v4.19-rc6-177-gcec4de302c5f#n68
      https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/fuse.h?id=v4.19-rc6-177-gcec4de302c5f#n756
      
      https://git.kernel.org/linus/a1d75f2582
      https://git.kernel.org/linus/2d45ba381a
      
      This patch adds support for "store notify". Adding support for "retrieve
      notify" might be added later since a) it is not needed right now, and b)
      supporting it is a bit more work since the kernel sends a separate reply
      with data and infrastructure has to be added to glue it back to original
      "retrieve notify" server-originated request.
      
      For user-visible API I decided not to duplicate FUSE-protocol naming
      1-1 and to be more explicit in names - emphasizing it is about cache
      control - it is e.g. InodeNotifyStoreCache instead of
      InodeNotifyStore, and for retrieving it (hopefully) should be just
      InodeRetrieveCache instead of InodeNotifyRetrieveCache and a
      separate callback.
      
      Thanks beforehand,
      Kirill
      bdca0e6a
  3. 01 Oct, 2018 3 commits
  4. 24 Sep, 2018 1 commit
  5. 31 Aug, 2018 3 commits
  6. 10 Aug, 2018 1 commit
    • Chris Marget's avatar
      Removed UID test and syscall-based unmount. · 95c63709
      Chris Marget authored
      On a Linux system with go-fuse program running as root, the mount is
      performed by calling /bin/fusermount, and the unmount is performed with
      syscall.Unmount()
      
      This creates a problem on systems (CentOS 6) with a static-but-edited-by-mount
      /etc/mtab file.
      
       - fusermount adds a line to mtab when the go-fuse program starts
       - syscall.Unmount() doesn't edit the file on program exit
       - subsequent invocations of the program fail to mount with:
      
          "Mount fail: fusermount exited with code 256"
      
      Deleting the now-inaccurate mtab entry clears things up.
      
      There's probably a workaround by adding "-n" option so that mount doesn't
      edit mtab in the first place, but it's not obvious where to insert that when
      starting with the hello.go example.
      95c63709
  7. 27 Jul, 2018 1 commit
  8. 25 Jul, 2018 1 commit
  9. 24 Jul, 2018 2 commits
  10. 22 May, 2018 2 commits
  11. 08 May, 2018 5 commits
  12. 02 May, 2018 1 commit
    • Jakob Unterwurzacher's avatar
      fuse: improve SETXATTR debug logging · 41df6ec8
      Jakob Unterwurzacher authored
      Set the operationHandlers[op].DecodeIn function and
      add xattr name parsing.
      
      SETXATTR is special because it is the only opcode that
      takes a file name (the xattr name) and a binary blob
      (the xattr value). This was not supported by the
      file name parsing code:
      * setting FileNames = 1 would lump the xattr name
        and value together and truncates the last byte
      * setting FileNames = 2 truncated the last xattr
        value byte.
      
      This was solved by adding a special-case to parse(),
      which seemed less ugly than adding a special-case
      InputDebug(), or leaving the truncation as-is.
      
      Before:
        2018/05/01 16:47:39 Dispatch 6: SETXATTR, NodeId: 3.  12 bytes
      After:
        2018/05/01 16:48:36 Dispatch 6: SETXATTR, NodeId: 3. data: {sz 3 f0} names: [user.foo] 12 bytes
      
      The change only affects debug output as doSetXAttr() does its
      own bytes.SplitN(). The parsed filename *could* also be used in
      doSetXAttr(), but the code seems clearer as-is.
      41df6ec8
  13. 23 Apr, 2018 1 commit
  14. 18 Mar, 2018 1 commit
  15. 16 Mar, 2018 1 commit
  16. 01 Mar, 2018 1 commit
  17. 02 Feb, 2018 1 commit
  18. 18 Jan, 2018 1 commit
  19. 12 Jan, 2018 1 commit
  20. 05 Dec, 2017 1 commit
  21. 13 Nov, 2017 1 commit
    • Jakob Unterwurzacher's avatar
      pathfs: simplify pathInode.GetAttr · 66de2f17
      Jakob Unterwurzacher authored
      The function was written with only a single return at
      the end, which was elegant, but harder to follow.
      
      Add early returns to handle common cases and add a few
      comments.
      
      A functional change is that we now catch when we get
      OK with fi == nil and return EINVAL and log a message.
      This should not happen and is a bug in the filesystem
      implementation.
      
      Passes ./all.bash and the gocryptfs test suite.
      66de2f17
  22. 07 Nov, 2017 2 commits
  23. 20 Oct, 2017 1 commit
  24. 19 Oct, 2017 3 commits
  25. 09 Oct, 2017 1 commit
    • Jakob Unterwurzacher's avatar
      debug output: fix blank line after READDIRPLUS · cfefa3d5
      Jakob Unterwurzacher authored
      Trivial patch that fixes a blank line in the debug output.
      
      Before:
      
        2017/10/03 20:25:56 Dispatch 602: READDIRPLUS, NodeId: 1. data: {Fh 2 off 0 sz 4096  L 0 DIRECTORY,NONBLOCK,0x8000}
        2017/10/03 20:25:56 Serialize 602: READDIRPLUS code: OK value:  832 bytes data
      
        2017/10/03 20:25:56 Dispatch 603: GETXATTR, NodeId: 7. data: {sz 0} names: [system.posix_acl_access] 24 bytes
        2017/10/03 20:25:56 Serialize 603: GETXATTR code: 61=no data available value:
      
      After:
      
        2017/10/03 21:02:46 Dispatch 22: READDIRPLUS, NodeId: 1. data: {Fh 2 off 0 sz 4096  L 0 RDONLY,0x8000}
        2017/10/03 21:02:46 Serialize 22: READDIRPLUS code: OK value:  648 bytes data
        2017/10/03 21:02:46 Dispatch 23: READDIRPLUS, NodeId: 1. data: {Fh 2 off 4 sz 4096  L 0 RDONLY,0x8000}
        2017/10/03 21:02:46 Serialize 23: READDIRPLUS code: OK value:
      cfefa3d5