diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c
index 6267ef541dbb9f2e015ae3ea4d82c934fad39250..9c9fbb1e94f720acf1173296a98802affe84d2c9 100644
--- a/lustre/lov/lov_obd.c
+++ b/lustre/lov/lov_obd.c
@@ -2080,10 +2080,11 @@ static int lov_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,
 
                         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);