LASSERT(lock != NULL);
loi->loi_rss = tmp;
- // Extend KMS up to the end of this lock, and no further
+ /* Extend KMS up to the end of this lock and no further
+ * A lock on [x,y] means a KMS of up to y + 1 bytes! */
if (tmp > lock->l_policy_data.l_extent.end)
tmp = lock->l_policy_data.l_extent.end + 1;
- if (tmp > loi->loi_kms) {
+ if (tmp >= loi->loi_kms) {
CDEBUG(D_INODE, "lock acquired, setting rss="
LPU64", kms="LPU64"\n", loi->loi_rss,
tmp);