vfs: try again to allocate a new mount group after resizing vfs.groupIDBitmap

Otherwise, a group id value is always 0x7fffffff in such cases.

PiperOrigin-RevId: 580619582
This commit is contained in:
Andrei Vagin
2023-11-08 12:35:59 -08:00
committed by gVisor bot
parent 0358995f0f
commit cfc24011ad
+4
View File
@@ -448,6 +448,10 @@ func (vfs *VirtualFilesystem) allocateGroupID(mnt *Mount) error {
if err := vfs.groupIDBitmap.Grow(uint32(vfs.groupIDBitmap.Size())); err != nil {
return linuxerr.ENOSPC
}
groupID, err = vfs.groupIDBitmap.FirstZero(1)
if err != nil {
return err
}
}
vfs.groupIDBitmap.Add(groupID)
mnt.groupID = groupID