Commit f25bfe9b authored by Bernd Lietzow's avatar Bernd Lietzow

Merge branch '954-int-overflow-v6' into 'v6'

Resolve "integer overflow with certain chunk sizes and number of targets"

See merge request beegfs/projects0!785
parents 3deca9fa 91ff4e41
......@@ -139,10 +139,7 @@ class StripePattern
*/
size_t getStripeTargetIndex(int64_t pos) const
{
const unsigned chunkSize = getChunkSize();
const unsigned stripeSetSize = getNumStripeTargetIDs() * chunkSize;
return (pos % stripeSetSize) / chunkSize;
return (pos / getChunkSize()) % getNumStripeTargetIDs();
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment