1. 27 Mar, 2019 4 commits
    • Han-Wen Nienhuys's avatar
    • Han-Wen Nienhuys's avatar
      nodefs: garbage collection of unreferenced nodes. · 1433ae4f
      Han-Wen Nienhuys authored
      Nodes can become unused due to following reasons:
      
      * no more children (see new RmChild function) 
      * no kernel references (Forget)
      * stop being persistent
      
      If this happens, drop the node from the tree. Removals of nodes
      cascade from leaves up to parents recursively
      
      lookupCount is now protected by under Inode.mu
      
      nodeID remains under bridge.mu
      1433ae4f
    • Han-Wen Nienhuys's avatar
      nodefs: sketch for a better NodeFS API · 2f61bee3
      Han-Wen Nienhuys authored
      Co-author: navytux
      
      Thanks to rfjakob for general feedback.
      
      Next:
      - add refctr like libfuse. Use it to implement persistent nodes 
      
      TODO
      - context for PID/caller
      - Opendir
      
      Open questions: grep for NOSUBMIT/TODO
      - how many interfaces?
      - explode SetAttr ?
      2f61bee3
    • Han-Wen Nienhuys's avatar
      fuse: ignore unrecognized opcodes · fd7328fa
      Han-Wen Nienhuys authored
      Go-FUSE has been trailing the kernel, and the kernel (usually) is
      careful to only send opcodes that are recognized. However, on GKE
      (GCP) the undefined opcode 2016 has been seen, leading to a crash.
      
      Fixes #276.
      fd7328fa
  2. 19 Mar, 2019 1 commit
  3. 12 Mar, 2019 1 commit
  4. 11 Mar, 2019 1 commit
  5. 09 Mar, 2019 2 commits
  6. 08 Mar, 2019 5 commits
  7. 06 Mar, 2019 1 commit
  8. 24 Feb, 2019 2 commits
  9. 23 Feb, 2019 2 commits
    • Han-Wen Nienhuys's avatar
      fuse: support RENAME2 in RawFileSystem · fb9b7327
      Han-Wen Nienhuys authored
      In practice, this only triggers for RENAME_EXCHANGE, as the kernel
      issues the RENAME opcode in case of a normal rename or a
      RENAME_NOREPLACE.
      
      We have always advertised rename2 support (protocol v23), but it returned
      ENOSYS always. Instead, rename RenameIn => Rename1In, and add Flags to
      RenameIn.
      
      For raw filesystems that want to support rename2 should examine
      RenameIn.Flags and check for syscall.RENAME_XXX.
      
      For fuse/nodefs, we return ENOSYS in case of Rename2, since we lack
      API surface to propagate the flags.
      fb9b7327
    • Han-Wen Nienhuys's avatar
      afa3a28f
  10. 17 Feb, 2019 5 commits
  11. 14 Feb, 2019 1 commit
    • Kirill Smelkov's avatar
      fuse: Fix InodeRetrieveCache to retrieve data in chunks · 58dcd77a
      Kirill Smelkov authored
      It turned out that:
      
      1. Linux kernel cannot send data in chunks bigger than what was
         configured as MaxWrite on init, and
      
      2. if we ask for more, and that more, after capping to kernel write
         maxium, is more than configured MaxWrite, the kernel will simply drop
         NOTIFY_REPLY message. This, hopefully, will be fixed
      
      	https://marc.info/?l=linux-fsdevel&m=155000277921155&w=2
      
         but we cannot count on this fix to be present on older kernels, and
         even if it is there, we still won't get more than MaxWrite data.
      
      -> Rework InodeRetrieveCache to retrieve the data in chunks.
      
      NOTE1: we do not load users with this FUSE exchange details and instead
      of returning less content than requested, try to retrieve it all.
      
      NOTE2: without changes to fuse/server.go, added test will get stuck (see
      details in above link to linux-fsdevel patch).
      58dcd77a
  12. 13 Feb, 2019 7 commits
  13. 07 Feb, 2019 1 commit
    • Ed Schouten's avatar
      Don't crash when calling truncate(1) on a handle without a File. · 33711add
      Ed Schouten authored
      For all operations that can be applied on file descriptors, we have
      special treatment to permit the File to be nil. In that case, operations
      are called against the Node object instead.
      
      This check currently seems missing from SetAttr(), causing invocations
      of the truncate(1) command line tool to cause a crash:
      
              panic: runtime error: invalid memory address or nil pointer dereference
              [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xa30d0d]
      
              goroutine 12 [running]:
              github.com/hanwen/go-fuse/fuse/nodefs.(*rawBridge).SetAttr(0xc00013ecc0, 0xc0003a8000, 0xc0003ba0f0, 0xa27b98)
                      external/com_github_hanwen_go_fuse/fuse/nodefs/fsops.go:203 +0x58d
              github.com/hanwen/go-fuse/fuse.doSetattr(0xc0003a4000, 0xc0003ba000)
                      external/com_github_hanwen_go_fuse/fuse/opcode.go:171 +0x64
              github.com/hanwen/go-fuse/fuse.(*Server).handleRequest(0xc0003a4000, 0xc0003ba000, 0xc0003ba000)
                      external/com_github_hanwen_go_fuse/fuse/server.go:431 +0x26b
              github.com/hanwen/go-fuse/fuse.(*Server).loop(0xc0003a4000, 0xc00000b101)
                      external/com_github_hanwen_go_fuse/fuse/server.go:403 +0x18f
              created by github.com/hanwen/go-fuse/fuse.(*Server).readRequest
                      external/com_github_hanwen_go_fuse/fuse/server.go:291 +0x2d8
      33711add
  14. 05 Feb, 2019 1 commit
  15. 04 Feb, 2019 3 commits
  16. 01 Feb, 2019 2 commits
  17. 30 Jan, 2019 1 commit