--- initial
+++ final
@@ -1,132 +1,132 @@
 int osc_build_rpc(const struct lu_env *env, struct client_obd *cli, struct list_head *ext_list, int cmd) {
   struct ptlrpc_request *req = NULL;
   struct osc_extent *ext;
   struct brw_page **pga = NULL;
   struct osc_brw_async_args *aa = NULL;
   struct obdo *oa = NULL;
   struct osc_async_page *oap;
   struct osc_object *obj = NULL;
   struct cl_req_attr *crattr = NULL;
   u64 starting_offset = OBD_OBJECT_EOF;
   u64 ending_offset = 0;
   int mpflag = 0;
   int mem_tight = 0;
   int page_count = 0;
   bool soft_sync = false;
   bool interrupted = false;
   int i;
   int rc;
   struct ost_body *body;
   LIST_HEAD(rpc_list);
   LASSERT(!list_empty(ext_list));
   /* add pages into rpc_list to build BRW rpc */
   list_for_each_entry(ext, ext_list, oe_link) {
     LASSERT(ext->oe_state == OES_RPC);
     mem_tight |= ext->oe_memalloc;
     page_count += ext->oe_nr_pages;
     if (!obj) obj = ext->oe_obj;
   }
   soft_sync = osc_over_unstable_soft_limit(cli);
   if (mem_tight) mpflag = cfs_memory_pressure_get_and_set();
   pga = kcalloc(page_count, sizeof(*pga), GFP_NOFS);
   if (!pga) {
     rc = -ENOMEM;
     goto out;
   }
   oa = kmem_cache_zalloc(obdo_cachep, GFP_NOFS);
   if (!oa) {
     rc = -ENOMEM;
     goto out;
   }
   i = 0;
   list_for_each_entry(ext, ext_list, oe_link) {
     list_for_each_entry(oap, &ext->oe_pages, oap_pending_item) {
       if (mem_tight) oap->oap_brw_flags |= OBD_BRW_MEMALLOC;
       if (soft_sync) oap->oap_brw_flags |= OBD_BRW_SOFT_SYNC;
       pga[i] = &oap->oap_brw_page;
       pga[i]->off = oap->oap_obj_off + oap->oap_page_off;
       i++;
       list_add_tail(&oap->oap_rpc_item, &rpc_list);
       if (starting_offset == OBD_OBJECT_EOF || starting_offset > oap->oap_obj_off)
         starting_offset = oap->oap_obj_off;
       else
         LASSERT(!oap->oap_page_off);
       if (ending_offset < oap->oap_obj_off + oap->oap_count)
         ending_offset = oap->oap_obj_off + oap->oap_count;
       else
         LASSERT(oap->oap_page_off + oap->oap_count == PAGE_SIZE);
       if (oap->oap_interrupted) interrupted = true;
     }
   }
   /* first page in the list */
   oap = list_entry(rpc_list.next, typeof(*oap), oap_rpc_item);
   crattr = &osc_env_info(env)->oti_req_attr;
   memset(crattr, 0, sizeof(*crattr));
   crattr->cra_type = (cmd & OBD_BRW_WRITE) ? CRT_WRITE : CRT_READ;
   crattr->cra_flags = ~0ULL;
   crattr->cra_page = oap2cl_page(oap);
   crattr->cra_oa = oa;
   cl_req_attr_set(env, osc2cl(obj), crattr);
   sort_brw_pages(pga, page_count);
   rc = osc_brw_prep_request(cmd, cli, oa, page_count, pga, &req, 1, 0);
   if (rc != 0) {
     CERROR("prep_req failed: %d\n", rc);
     goto out;
   }
   req->rq_commit_cb = brw_commit;
   req->rq_interpret_reply = brw_interpret;
   req->rq_memalloc = mem_tight != 0;
   oap->oap_request = ptlrpc_request_addref(req);
   if (interrupted && !req->rq_intr) ptlrpc_mark_interrupted(req);
   /* Need to update the timestamps after the request is built in case
    * we race with setattr (locally or in queue at OST).  If OST gets
    * later setattr before earlier BRW (as determined by the request xid),
    * the OST will not use BRW timestamps.  Sadly, there is no obvious
    * way to do this in a single call.  bug 10150
    */
   body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
   crattr->cra_oa = &body->oa;
   crattr->cra_flags = OBD_MD_FLMTIME | OBD_MD_FLCTIME | OBD_MD_FLATIME;
   cl_req_attr_set(env, osc2cl(obj), crattr);
   lustre_msg_set_jobid(req->rq_reqmsg, crattr->cra_jobid);
-  CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
+  BUILD_BUG_ON(sizeof(*aa) > sizeof(req->rq_async_args));
   aa = ptlrpc_req_async_args(req);
   INIT_LIST_HEAD(&aa->aa_oaps);
   list_splice_init(&rpc_list, &aa->aa_oaps);
   INIT_LIST_HEAD(&aa->aa_exts);
   list_splice_init(ext_list, &aa->aa_exts);
   spin_lock(&cli->cl_loi_list_lock);
   starting_offset >>= PAGE_SHIFT;
   if (cmd == OBD_BRW_READ) {
     cli->cl_r_in_flight++;
     lprocfs_oh_tally_log2(&cli->cl_read_page_hist, page_count);
     lprocfs_oh_tally(&cli->cl_read_rpc_hist, cli->cl_r_in_flight);
     lprocfs_oh_tally_log2(&cli->cl_read_offset_hist, starting_offset + 1);
   } else {
     cli->cl_w_in_flight++;
     lprocfs_oh_tally_log2(&cli->cl_write_page_hist, page_count);
     lprocfs_oh_tally(&cli->cl_write_rpc_hist, cli->cl_w_in_flight);
     lprocfs_oh_tally_log2(&cli->cl_write_offset_hist, starting_offset + 1);
   }
   spin_unlock(&cli->cl_loi_list_lock);
   DEBUG_REQ(D_INODE, req, "%d pages, aa %p. now %ur/%dw in flight", page_count, aa, cli->cl_r_in_flight, cli->cl_w_in_flight);
   OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_IO, cfs_fail_val);
   ptlrpcd_add_req(req);
   rc = 0;
 out:
   if (mem_tight != 0) cfs_memory_pressure_restore(mpflag);
   if (rc != 0) {
     LASSERT(!req);
     if (oa) kmem_cache_free(obdo_cachep, oa);
     kfree(pga);
     /* this should happen rarely and is pretty bad, it makes the
      * pending list not follow the dirty order
      */
     while (!list_empty(ext_list)) {
       ext = list_entry(ext_list->next, struct osc_extent, oe_link);
       list_del_init(&ext->oe_link);
       osc_extent_finish(env, ext, 0, rc);
     }
   }
   return rc;
 }<sep>@@
expression e1,e2;
@@
-               CLASSERT(e1 <= e2);
+               BUILD_BUG_ON(e1 > e2);