Commit 3a8e4783 authored by Kirill Smelkov's avatar Kirill Smelkov Committed by Han-Wen Nienhuys

nodefs: Skip TestNodeParallelLookup on kernels that don't have CAP_PARALLEL_DIROPS

If kernel internally serializes lookup requests for a directory, the
test will deadlock, becaue it tries to issue two such request and pause
lookup handlers, untill both requests come in.

For example here is how this test hangs on Ubuntu Xenial 16.04:

kirr@kubu:~/t/go-fuse$ go test -count=1 -v -run TestNodeParallelLookup ./fuse/test/
=== RUN   TestNodeParallelLookup
18:24:38.494651 rx 1: INIT i0 {7.23 Ra 0x20000 POSIX_LOCKS,ATOMIC_O_TRUNC,EXPORT_SUPPORT,DONT_MASK,FLOCK_LOCKS,READDIRPLUS_AUTO,ASYNC_DIO,WRITEBACK_CACHE,SPLICE_WRITE,SPLICE_READ,IOCTL_DIR,AUTO_INVAL_DATA,READDIRPLUS,NO_OPEN_SUPPORT,ASYNC_READ,BIG_WRITES,SPLICE_MOVE}
18:24:38.494713 tx 1:     OK, {7.23 Ra 0x20000 ASYNC_READ,BIG_WRITES,AUTO_INVAL_DATA,READDIRPLUS,NO_OPEN_SUPPORT 0/0 Wr 0x10000 Tg 0x0}
18:24:38.495351 rx 2: LOOKUP i1 [".go-fuse-epoll-hack"] 20b
18:24:38.495467 tx 2:     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}}
18:24:38.495530 rx 3: OPEN i18446744073709551615 {O_RDONLY,0x8000}
18:24:38.495575 tx 3:     OK, {Fh 18446744073709551615 }
18:24:38.495624 rx 4: POLL i18446744073709551615
18:24:38.495659 tx 4:     38=function not implemented
18:24:38.495706 rx 5: FLUSH i18446744073709551615 {Fh 18446744073709551615}
18:24:38.495741 tx 5:     34=numerical result out of range
18:24:38.495812 rx 6: RELEASE i18446744073709551615 {Fh 18446744073709551615 0x8000  L0}
18:24:38.495849 tx 6:     34=numerical result out of range
18:24:38.495904 rx 7: LOOKUP i1 ["world"] 6b
18:24:38.495957 I: <- lookup "world"
< hang >

Amends: 17c0c400 (nodefs: Allow for several Lookup requests to be served simultaneously)
Updates: https://github.com/hanwen/go-fuse/issues/261

Change-Id: I5d0a76d1190af805351326c378f69cf8ff781a37
parent ffb96eff
...@@ -98,6 +98,11 @@ func TestNodeParallelLookup(t *testing.T) { ...@@ -98,6 +98,11 @@ func TestNodeParallelLookup(t *testing.T) {
} }
}() }()
// the test will deadlock if the client cannot issue several lookups simultaneously
if srv.KernelSettings().Flags & fuse.CAP_PARALLEL_DIROPS == 0 {
t.Skip("Kernel serializes dir lookups")
}
// spawn 2 threads to access the files in parallel // spawn 2 threads to access the files in parallel
// this will deadlock if nodefs does not allow simultaneous Lookups to be handled. // this will deadlock if nodefs does not allow simultaneous Lookups to be handled.
// see https://github.com/hanwen/go-fuse/commit/d0fca860 for context. // see https://github.com/hanwen/go-fuse/commit/d0fca860 for context.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment