Due to a bug in the resources chopping logic:
When chopping different resources with the same name (e.g. vanilla disk and mount disk), we only include one of the resources. For example, if a role has a quota of 100disk, and an agent has 50 vanilla disk and 50 mount disk, the offer will only contain 50 disk (either vanilla or the mount type). The correct behavior should be that both disks should be offered.
Since today, only disk resources might have the same name but different meta-data (for unreserved/nonrevocable/nonshared resources – we only chop this), this bug should only affect disk resources today.
The correct code should be: