Whamcloud - gitweb
Reverted #974 for now as it causes problems for people.
[fs/lustre-release.git] / lustre / ost / ost_handler.c
index a281e98..a83592f 100644 (file)
@@ -384,6 +384,9 @@ static int ost_brw_read(struct ptlrpc_request *req)
                 GOTO(out, rc = -EFAULT);
         }
 
+        /* BUG 974: when we send back cache grants, don't clear this flag */
+        body->oa.o_valid &= ~OBD_MD_FLRDEV;
+
         ioo = lustre_swab_reqbuf(req, 1, sizeof(*ioo), lustre_swab_obd_ioobj);
         if (ioo == NULL) {
                 CERROR("Missing/short ioobj\n");
@@ -475,15 +478,15 @@ static int ost_brw_read(struct ptlrpc_request *req)
         rc = obd_commitrw(OBD_BRW_READ, req->rq_export, &body->oa, 1,
                           ioo, npages, local_nb, &oti);
 
-        if (rc == 0) {
-                repbody = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*repbody));
-                memcpy(&repbody->oa, &body->oa, sizeof(repbody->oa));
+        repbody = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*repbody));
+        memcpy(&repbody->oa, &body->oa, sizeof(repbody->oa));
 
 #if CHECKSUM_BULK
+        if (rc == 0) {
                 repbody->oa.o_nlink = ost_checksum_bulk(desc);
                 repbody->oa.o_valid |= OBD_MD_FLCKSUM;
-#endif
         }
+#endif
 
  out_bulk:
         ptlrpc_free_bulk(desc);
@@ -561,6 +564,9 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti)
                 GOTO(out, rc = -EFAULT);
         }
 
+        /* BUG 974: when we send back cache grants, don't clear this flag */
+        body->oa.o_valid &= ~OBD_MD_FLRDEV;
+
         LASSERT_REQSWAB(req, 1);
         objcount = req->rq_reqmsg->buflens[1] / sizeof(*ioo);
         if (objcount == 0) {