mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Replace type assertion with TaskFromContext.
This should fix panic at aio callback. PiperOrigin-RevId: 305798549
This commit is contained in:
@@ -535,7 +535,7 @@ func (s *SocketOperations) Write(ctx context.Context, _ *fs.File, src usermem.IO
|
||||
}
|
||||
|
||||
if resCh != nil {
|
||||
t := ctx.(*kernel.Task)
|
||||
t := kernel.TaskFromContext(ctx)
|
||||
if err := t.Block(resCh); err != nil {
|
||||
return 0, syserr.FromError(err).ToError()
|
||||
}
|
||||
@@ -608,7 +608,7 @@ func (s *SocketOperations) ReadFrom(ctx context.Context, _ *fs.File, r io.Reader
|
||||
}
|
||||
|
||||
if resCh != nil {
|
||||
t := ctx.(*kernel.Task)
|
||||
t := kernel.TaskFromContext(ctx)
|
||||
if err := t.Block(resCh); err != nil {
|
||||
return 0, syserr.FromError(err).ToError()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user