Whamcloud - gitweb
b=22755 don't leak grant if write failed with EDQUOT
authorOleg Drokin <oleg.drokin@oracle.com>
Thu, 27 May 2010 16:22:43 +0000 (18:22 +0200)
committerJohann Lombardi <johann@sun.com>
Thu, 27 May 2010 16:22:43 +0000 (18:22 +0200)
i=johann
i=wangdi

lustre/ChangeLog
lustre/osc/osc_request.c

index 8beb092..648a7f2 100644 (file)
@@ -50,6 +50,10 @@ Description: The shrink grant feature is still active on the client although the
             connect flag is not set.
 
 Severity   : normal
+Bugzilla   : 22755
+Description: Don't leak grant space if the write failed with quota exceeded.
+
+Severity   : normal
 Bugzilla   : 22610
 Description: a race condition could lead to SIGBUS being sent to an
             application using mmap-ped files from Lustre
index 3676481..44adfc0 100644 (file)
@@ -1423,14 +1423,14 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
                              body->oa.o_gid, body->oa.o_valid,
                              body->oa.o_flags);
 
+        osc_update_grant(cli, body);
+
         if (rc < 0)
                 RETURN(rc);
 
         if (aa->aa_oa->o_valid & OBD_MD_FLCKSUM)
                 client_cksum = aa->aa_oa->o_cksum; /* save for later */
 
-        osc_update_grant(cli, body);
-
         if (lustre_msg_get_opc(req->rq_reqmsg) == OST_WRITE) {
                 if (rc > 0) {
                         CERROR ("Unexpected +ve rc %d\n", rc);
@@ -1596,7 +1596,7 @@ int osc_brw_redo_request(struct ptlrpc_request *request,
         ENTRY;
 
         if (!osc_should_resend(aa->aa_resends, aa->aa_cli)) {
-                CERROR("too many resend retries, returning error\n");
+                CERROR("too many resent retries, returning error\n");
                 RETURN(-EIO);
         }