Whamcloud - gitweb
Set loi_kms_valid even if we get a lock back that has rss == kms. This
authoruid707 <uid707>
Tue, 9 Mar 2004 08:47:20 +0000 (08:47 +0000)
committeruid707 <uid707>
Tue, 9 Mar 2004 08:47:20 +0000 (08:47 +0000)
happens for zero-length files, and without this we will revoke our own
lock the next time we write to the file because osc_enqueue() won't match.
b=2818

lustre/lov/lov_obd.c

index 6267ef5..9c9fbb1 100644 (file)
@@ -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);