Whamcloud - gitweb
Branch b1_6
authoradilger <adilger>
Thu, 31 May 2007 21:54:48 +0000 (21:54 +0000)
committeradilger <adilger>
Thu, 31 May 2007 21:54:48 +0000 (21:54 +0000)
Always send IO to OST_IO_PORTAL regardless of what the default portal is.
Was previously broken for echo_client on catamount, but would also break
on 1.8 once the default request portal is REQPORTAL.

Detect if OST_WRITE or OST_READ requests go to non-IO portals, as that
would LBUG the server due to lack of IO buffers.
b=11813
i=green
i=shadow

lustre/osc/osc_request.c
lustre/ost/ost_handler.c

index 3d2a6eb..89a07b2 100644 (file)
@@ -475,10 +475,7 @@ static int osc_punch(struct obd_export *exp, struct obd_info *oinfo,
         if (!req)
                 RETURN(-ENOMEM);
 
-        /* FIXME bug 249. Also see bug 7198 */
-        if (class_exp2cliimp(exp)->imp_connect_data.ocd_connect_flags &
-            OBD_CONNECT_REQPORTAL)
-                req->rq_request_portal = OST_IO_PORTAL;
+        req->rq_request_portal = OST_IO_PORTAL;         /* bug 7198 */
 
         body = lustre_msg_buf(req->rq_reqmsg, REQ_REC_OFF, sizeof(*body));
         memcpy(&body->oa, oinfo->oi_oa, sizeof(*oinfo->oi_oa));
@@ -575,10 +572,7 @@ static int osc_destroy(struct obd_export *exp, struct obdo *oa,
         if (!req)
                 RETURN(-ENOMEM);
 
-        /* FIXME bug 249. Also see bug 7198 */
-        if (class_exp2cliimp(exp)->imp_connect_data.ocd_connect_flags &
-            OBD_CONNECT_REQPORTAL)
-                req->rq_request_portal = OST_IO_PORTAL;
+        req->rq_request_portal = OST_IO_PORTAL;         /* bug 7198 */
 
         body = lustre_msg_buf(req->rq_reqmsg, REQ_REC_OFF, sizeof(*body));
 
@@ -905,10 +899,7 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,struct obdo *oa,
         if (req == NULL)
                 RETURN (-ENOMEM);
 
-        /* FIXME bug 249. Also see bug 7198 */
-        if (cli->cl_import->imp_connect_data.ocd_connect_flags &
-            OBD_CONNECT_REQPORTAL)
-                req->rq_request_portal = OST_IO_PORTAL;
+        req->rq_request_portal = OST_IO_PORTAL;         /* bug 7198 */
 
         if (opc == OST_WRITE)
                 desc = ptlrpc_prep_bulk_imp (req, page_count,
index 162caa2..85aed53 100644 (file)
@@ -1438,6 +1438,14 @@ static int ost_handle(struct ptlrpc_request *req)
                 break;
         case OST_WRITE:
                 CDEBUG(D_INODE, "write\n");
+                /* req->rq_request_portal would be nice, if it was set */
+                if (req->rq_rqbd->rqbd_service->srv_req_portal !=OST_IO_PORTAL){
+                        CERROR("%s: deny write request from %s to portal %u\n",
+                               req->rq_export->exp_obd->obd_name,
+                               obd_export_nid2str(req->rq_export),
+                               req->rq_rqbd->rqbd_service->srv_req_portal);
+                        GOTO(out, rc = -EPROTO);
+                }
                 OBD_FAIL_RETURN(OBD_FAIL_OST_BRW_NET, 0);
                 if (OBD_FAIL_CHECK_ONCE(OBD_FAIL_OST_ENOSPC))
                         GOTO(out, rc = -ENOSPC);
@@ -1449,6 +1457,14 @@ static int ost_handle(struct ptlrpc_request *req)
                 RETURN(rc);
         case OST_READ:
                 CDEBUG(D_INODE, "read\n");
+                /* req->rq_request_portal would be nice, if it was set */
+                if (req->rq_rqbd->rqbd_service->srv_req_portal !=OST_IO_PORTAL){
+                        CERROR("%s: deny read request from %s to portal %u\n",
+                               req->rq_export->exp_obd->obd_name,
+                               obd_export_nid2str(req->rq_export),
+                               req->rq_rqbd->rqbd_service->srv_req_portal);
+                        GOTO(out, rc = -EPROTO);
+                }
                 OBD_FAIL_RETURN(OBD_FAIL_OST_BRW_NET, 0);
                 rc = ost_brw_read(req, oti);
                 LASSERT(current->journal_info == NULL);