mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Order Inotify.evMu under mm.activeMu.
Documented this order in package mm in a rather clumsy way. PiperOrigin-RevId: 434524876
This commit is contained in:
committed by
gVisor bot
parent
ee133dbcf2
commit
ea631ae102
@@ -257,11 +257,11 @@ func (i *Inotify) Ioctl(ctx context.Context, uio usermem.IO, args arch.SyscallAr
|
||||
switch args[1].Int() {
|
||||
case linux.FIONREAD:
|
||||
i.evMu.Lock()
|
||||
defer i.evMu.Unlock()
|
||||
var n uint32
|
||||
for e := i.events.Front(); e != nil; e = e.Next() {
|
||||
n += uint32(e.sizeOf())
|
||||
}
|
||||
i.evMu.Unlock()
|
||||
var buf [4]byte
|
||||
hostarch.ByteOrder.PutUint32(buf[:], n)
|
||||
_, err := uio.CopyOut(ctx, args[2].Pointer(), buf[:], usermem.IOOpts{})
|
||||
|
||||
Reference in New Issue
Block a user