From 298a51c37a2bc02753b7116a5a3912dee008940e Mon Sep 17 00:00:00 2001
From: yury <yury>
Date: Mon, 24 Nov 2008 15:13:11 +0000
Subject: [PATCH] b=17631

- fix previous wrong commit in part related to changes in ptlrpc_abort_bulk()
---
 lustre/include/lustre_net.h | 2 +-
 lustre/ldlm/ldlm_request.c  | 3 +--
 lustre/mds/handler.c        | 2 +-
 lustre/ost/ost_handler.c    | 8 ++++----
 lustre/ptlrpc/niobuf.c      | 7 +++----
 5 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h
index 624d713482..20e58ff9f2 100644
--- a/lustre/include/lustre_net.h
+++ b/lustre/include/lustre_net.h
@@ -752,7 +752,7 @@ extern lnet_pid_t ptl_get_pid(void);
 
 /* ptlrpc/niobuf.c */
 int ptlrpc_start_bulk_transfer(struct ptlrpc_bulk_desc *desc);
-void ptlrpc_abort_bulk(struct ptlrpc_request *req);
+void ptlrpc_abort_bulk(struct ptlrpc_bulk_desc *desc);
 int ptlrpc_register_bulk(struct ptlrpc_request *req);
 int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async);
 
diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c
index 60d6cc29dd..fd55f77b5d 100644
--- a/lustre/ldlm/ldlm_request.c
+++ b/lustre/ldlm/ldlm_request.c
@@ -360,9 +360,8 @@ static void failed_lock_cleanup(struct ldlm_namespace *ns,
 
         /* XXX - HACK because we shouldn't call ldlm_lock_destroy()
          *       from llite/file.c/ll_file_flock(). */
-        if (lock->l_resource->lr_type == LDLM_FLOCK) {
+        if (lock->l_resource->lr_type == LDLM_FLOCK)
                 ldlm_lock_destroy(lock);
-        }
 }
 
 int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req,
diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c
index cfed97733b..4599cb5bc1 100644
--- a/lustre/mds/handler.c
+++ b/lustre/mds/handler.c
@@ -168,7 +168,7 @@ static int mds_sendpage(struct ptlrpc_request *req, struct file *file,
 
         EXIT;
  abort_bulk:
-        ptlrpc_abort_bulk(req);
+        ptlrpc_abort_bulk(desc);
  cleanup_buf:
         for (i = 0; i < npages; i++)
                 if (pages[i])
diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c
index 8b1e34c5cf..4e7cee0408 100644
--- a/lustre/ost/ost_handler.c
+++ b/lustre/ost/ost_handler.c
@@ -890,11 +890,11 @@ static int ost_brw_read(struct ptlrpc_request *req, struct obd_trans_info *oti)
                                           req->rq_deadline - start,
                                           cfs_time_current_sec() -
                                           req->rq_deadline);
-                                ptlrpc_abort_bulk(req);
+                                ptlrpc_abort_bulk(desc);
                         } else if (exp->exp_failed) {
                                 DEBUG_REQ(D_ERROR, req, "Eviction on bulk PUT");
                                 rc = -ENOTCONN;
-                                ptlrpc_abort_bulk(req);
+                                ptlrpc_abort_bulk(desc);
                         } else if (!desc->bd_success ||
                                    desc->bd_nob_transferred != desc->bd_nob) {
                                 DEBUG_REQ(D_ERROR, req, "%s bulk PUT %d(%d)",
@@ -1122,11 +1122,11 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti)
                                   req->rq_deadline - start,
                                   cfs_time_current_sec() -
                                   req->rq_deadline);
-                        ptlrpc_abort_bulk(req);
+                        ptlrpc_abort_bulk(desc);
                 } else if (desc->bd_export->exp_failed) {
                         DEBUG_REQ(D_ERROR, req, "Eviction on bulk GET");
                         rc = -ENOTCONN;
-                        ptlrpc_abort_bulk(req);
+                        ptlrpc_abort_bulk(desc);
                 } else if (!desc->bd_success ||
                            desc->bd_nob_transferred != desc->bd_nob) {
                         DEBUG_REQ(D_ERROR, req, "%s bulk GET %d(%d)",
diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c
index eedbb41749..613ef6f806 100644
--- a/lustre/ptlrpc/niobuf.c
+++ b/lustre/ptlrpc/niobuf.c
@@ -166,15 +166,14 @@ int ptlrpc_start_bulk_transfer(struct ptlrpc_bulk_desc *desc)
 
 /* Server side bulk abort. Idempotent. Not thread-safe (i.e. only
  * serialises with completion callback) */
-void ptlrpc_abort_bulk(struct ptlrpc_request *req)
+void ptlrpc_abort_bulk(struct ptlrpc_bulk_desc *desc)
 {
-        struct ptlrpc_bulk_desc *desc = req->rq_bulk;
         struct l_wait_info       lwi;
         int                      rc;
 
         LASSERT(!in_interrupt());               /* might sleep */
 
-        if (!ptlrpc_client_bulk_active(req))           /* completed or */
+        if (!ptlrpc_server_bulk_active(desc))   /* completed or */
                 return;                         /* never started */
         
         /* Do not send any meaningful data over the wire for evicted clients */
@@ -194,7 +193,7 @@ void ptlrpc_abort_bulk(struct ptlrpc_request *req)
                 lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(LONG_UNLINK),
                                            cfs_time_seconds(1), NULL, NULL);
                 rc = l_wait_event(desc->bd_waitq, 
-                                  !ptlrpc_client_bulk_active(req), &lwi);
+                                  !ptlrpc_server_bulk_active(desc), &lwi);
                 if (rc == 0)
                         return;
 
-- 
GitLab