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:
Nicolas Lacasse
2022-03-14 11:48:29 -07:00
committed by gVisor bot
parent ee133dbcf2
commit ea631ae102
+1 -1
View File
@@ -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{})