Skip to content

Commit ff8b308

Browse files
nixprimegvisor-bot
authored andcommitted
Remove call to Notify from pipe.VFSPipeFD.CopyOutFrom.
This was missed in cl/351911375; pipe.VFSPipeFD.SpliceFromNonPipe already calls Notify. PiperOrigin-RevId: 355246655
1 parent fcc2468 commit ff8b308

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pkg/sentry/kernel/pipe/vfs.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -368,17 +368,15 @@ func (fd *VFSPipeFD) CopyInTo(ctx context.Context, ars usermem.AddrRangeSeq, dst
368368
})
369369
}
370370

371-
// CopyOutFrom implements usermem.IO.CopyOutFrom.
371+
// CopyOutFrom implements usermem.IO.CopyOutFrom. Note that it is the caller's
372+
// responsibility to call fd.pipe.Notify(waiter.EventIn) after the write is
373+
// completed.
372374
//
373375
// Preconditions: fd.pipe.mu must be locked.
374376
func (fd *VFSPipeFD) CopyOutFrom(ctx context.Context, ars usermem.AddrRangeSeq, src safemem.Reader, opts usermem.IOOpts) (int64, error) {
375-
n, err := fd.pipe.writeLocked(ars.NumBytes(), func(dsts safemem.BlockSeq) (uint64, error) {
377+
return fd.pipe.writeLocked(ars.NumBytes(), func(dsts safemem.BlockSeq) (uint64, error) {
376378
return src.ReadToBlocks(dsts)
377379
})
378-
if n > 0 {
379-
fd.pipe.Notify(waiter.EventIn)
380-
}
381-
return n, err
382380
}
383381

384382
// SwapUint32 implements usermem.IO.SwapUint32.

0 commit comments

Comments
 (0)