• Jakob Unterwurzacher's avatar
    Make pollHack work on read-only mounts · fee50bf0
    Jakob Unterwurzacher authored
    Use LOOKUP & OPEN instead of CREATE so it also
    works on read-only mounts.
    
    go-fuse/fs$ go test -run TestRoMount -v
    === RUN   TestRoMount
    20:31:07.892736 rx 2: INIT i0 {7.31 Ra 0x20000 NO_OPEN_SUPPORT,ASYNC_READ,POSIX_LOCKS,EXPORT_SUPPORT,AUTO_INVAL_DATA,SPLICE_MOVE,SPLICE_READ,HANDLE_KILLPRIV,ABORT_ERROR,EXPLICIT_INVAL_DATA,BIG_WRITES,SPLICE_WRITE,READDIRPLUS,WRITEBACK_CACHE,IOCTL_DIR,READDIRPLUS_AUTO,ASYNC_DIO,PARALLEL_DIROPS,ATOMIC_O_TRUNC,DONT_MASK,FLOCK_LOCKS,POSIX_ACL,MAX_PAGES,CACHE_SYMLINKS,NO_OPENDIR_SUPPORT}
    20:31:07.892799 tx 2:     OK, {7.28 Ra 0x20000 BIG_WRITES,READDIRPLUS,PARALLEL_DIROPS,ASYNC_READ,AUTO_INVAL_DATA,NO_OPEN_SUPPORT 0/0 Wr 0x10000 Tg 0x0}
    20:31:07.892967 rx 4: LOOKUP i1 [".go-fuse-epoll-hack"] 20b
    20:31:07.893002 tx 4:     OK, {i18446744073709551615 g0 tE=0s tA=0s {M0100644 SZ=0 L=1 0:0 B0*0 i0:18446744073709551615 A 0.000000 M 0.000000 C 0.000000}}
    20:31:07.893030 rx 6: OPEN i18446744073709551615 {O_RDONLY,0x8000}
    20:31:07.893037 tx 6:     OK, {Fh 18446744073709551615 }
    20:31:07.893053 rx 8: POLL i18446744073709551615
    20:31:07.893059 tx 8:     38=function not implemented
    20:31:07.893074 rx 10: FLUSH i18446744073709551615 {Fh 18446744073709551615}
    20:31:07.893079 tx 10:     34=numerical result out of range
    20:31:07.893131 rx 12: RELEASE i18446744073709551615 {Fh 18446744073709551615 0x8000  L0}
    20:31:07.893153 tx 12:     34=numerical result out of range
    20:31:07.896705 received ENODEV (unmount request), thread exiting
    20:31:07.896719 received ENODEV (unmount request), thread exiting
    20:31:07.896888 received ENODEV (unmount request), thread exiting
    
    Change-Id: I6de861bdccf03184a4ca3deeefb1cfdc930aabe3
    --- PASS: TestRoMount (0.01s)
    PASS
    ok  	github.com/hanwen/go-fuse/v2/fs	0.015s
    
    Change-Id: Ic66ca153f5b739e5e081988fdc48d51cde5470f0
    fee50bf0
poll.go 999 Bytes