Whamcloud - gitweb
Branch b1_6
authorwangdi <wangdi>
Wed, 30 May 2007 11:41:11 +0000 (11:41 +0000)
committerwangdi <wangdi>
Wed, 30 May 2007 11:41:11 +0000 (11:41 +0000)
Grant the space immediately for ungrant I/O req to avoid grant space > left
available space.
b=11662
i=adilger
i=green

lustre/ChangeLog
lustre/obdfilter/filter_io.c
lustre/tests/sanityN.sh

index 2813bb5..40afede 100644 (file)
@@ -169,6 +169,17 @@ Details       : When osc reconnect to OST, OST(filter)should clear grant info of
             these of resend/replay write req.
 
 Severity   : normal
+Frequency  : rare 
+Bugzilla   : 11662
+Description: Grant space more than avaiable left space sometimes.
+Details           : When then OST is about to be full, if two bulk writing from
+            different clients came to OST. Accord the avaliable space of the
+            OST, the first req should be permitted, and the second one
+            should be denied by ENOSPC. But if the seconde arrived before 
+            the first one is commited. The OST might wrongly permit second
+            writing, which will cause grant space > avaiable space.
+
+Severity   : normal
 Frequency  : when client is evicted 
 Bugzilla   : 12371
 Description: Grant might be wrongly erased when osc is evicted by OST
@@ -912,7 +923,6 @@ Details    : the performance loss is caused by using of write barriers in the
             ext3 code. The SLES10 kernel turns barrier support on by
             default. The fix is to undo that change for ldiskfs.
 
-
 ------------------------------------------------------------------------------
 
 2006-12-09  Cluster File Systems, Inc. <info@clusterfs.com>
index 2f486a2..029eaf4 100644 (file)
@@ -435,6 +435,7 @@ static int filter_grant_check(struct obd_export *exp, struct obdo *oa,
                                 /* if enough space, pretend it was granted */
                                 ungranted += bytes;
                                 rnb[n].flags |= OBD_BRW_GRANTED;
+                                lnb[n].lnb_grant_used = bytes;
                                 CDEBUG(0, "idx %d ungranted=%lu\n",n,ungranted);
                                 rc = 0;
                                 continue;
@@ -460,8 +461,9 @@ static int filter_grant_check(struct obd_export *exp, struct obdo *oa,
          * happens in filter_grant_commit() after the writes are done. */
         *left -= ungranted;
         fed->fed_grant -= used;
-        fed->fed_pending += used;
-        exp->exp_obd->u.filter.fo_tot_pending += used;
+        fed->fed_pending += used + ungranted;
+        exp->exp_obd->u.filter.fo_tot_granted += ungranted;
+        exp->exp_obd->u.filter.fo_tot_pending += used + ungranted;
 
         CDEBUG(mask,
                "%s: cli %s/%p used: %lu ungranted: %lu grant: %lu dirty: %lu\n",
index ab9e37b..bbf9e97 100644 (file)
@@ -456,6 +456,8 @@ run_test 14d "chmod of executing file is still possible ========"
 test_15() {    # bug 974 - ENOSPC
        echo "PATH=$PATH"
        sh oos2.sh $MOUNT1 $MOUNT2
+       grant_error=`dmesg | grep "> available"`
+       [ -z "$grant_error" ] || error "$grant_error"
 }
 run_test 15 "test out-of-space with multiple writers ==========="