From 80cc2c78e52389015459114b1689cd3265726679 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Mon, 20 May 2019 16:52:03 -0700 Subject: Forward named pipe creation to the gofer The backing 9p server must allow named pipe creation, which the runsc fsgofer currently does not. There are small changes to the overlay here. GetFile may block when opening a named pipe, which can cause a deadlock: 1. open(O_RDONLY) -> copyMu.Lock() -> GetFile() 2. open(O_WRONLY) -> copyMu.Lock() -> Deadlock A named pipe usable for writing must already be on the upper filesystem, but we are still taking copyMu for write when checking for upper. That can be changed to a read lock to fix the common case. However, a named pipe on the lower filesystem would still deadlock in open(O_WRONLY) when it tries to actually perform copy up (which would simply return EINVAL). Move the copy up type check before taking copyMu for write to avoid this. p9 must be modified, as it was incorrectly removing the file mode when sending messages on the wire. PiperOrigin-RevId: 249154033 Change-Id: Id6637130e567b03758130eb6c7cdbc976384b7d6 --- pkg/p9/local_server/local_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/p9/local_server/local_server.go') diff --git a/pkg/p9/local_server/local_server.go b/pkg/p9/local_server/local_server.go index d49d94550..9546b3de5 100644 --- a/pkg/p9/local_server/local_server.go +++ b/pkg/p9/local_server/local_server.go @@ -252,7 +252,7 @@ func (l *local) Link(target p9.File, newname string) error { // Mknod implements p9.File.Mknod. // // Not implemented. -func (l *local) Mknod(name string, permissions p9.FileMode, major uint32, minor uint32, _ p9.UID, _ p9.GID) (p9.QID, error) { +func (l *local) Mknod(name string, mode p9.FileMode, major uint32, minor uint32, _ p9.UID, _ p9.GID) (p9.QID, error) { return p9.QID{}, syscall.ENOSYS } -- cgit v1.2.3