Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion domain/fuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type FuseServerIface interface {
Destroy() error
MountPoint() string
Unmount()
InitWait()
InitWait() bool
SetCntrRegComplete()
IsCntrRegCompleted() bool
}
6 changes: 4 additions & 2 deletions fuse/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func (s *fuseServer) Create() error {
}

func (s *fuseServer) Run() error {
defer close(s.initDone)
//
// Creating a FUSE mount at the associated mountpoint.
//
Expand Down Expand Up @@ -202,8 +203,9 @@ func (s *fuseServer) Root() (bfusefs.Node, error) {

// Ensure that fuse-server initialization is completed before moving on
// with sys container's pre-registration sequence.
func (s *fuseServer) InitWait() {
<-s.initDone
func (s *fuseServer) InitWait() bool {
_, ok := <-s.initDone
return ok
}

func (s *fuseServer) MountPoint() string {
Expand Down
4 changes: 3 additions & 1 deletion fuse/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ func (fss *FuseServerService) CreateFuseServer(serveCntr, stateCntr domain.Conta
// Launch fuse-server in a separate goroutine and wait for 'ack' before
// moving on.
go srv.Run()
srv.InitWait()
if !srv.InitWait() {
return errors.New("FuseServer InitWait error")
}

// Store newly created fuse-server.
fss.Lock()
Expand Down