  	struct bmapc_memb		*biorq_bmap;	/* backpointer to our bmap	*/
  	struct pscrpc_request_set	*biorq_rqset;
  	struct psc_waitq		 biorq_waitq;	/* used by a bmpce */
-@@ -296,6 +296,8 @@
+@@ -298,6 +298,8 @@
  #define BIORQ_BMAPFAIL			(1 << 20)
  #define BIORQ_READFAIL			(1 << 21)
  #define BIORQ_PENDING			(1 << 22)

 		car->car_fsrqinfo = r->biorq_fsrqi;
 		car->car_len = r->biorq_len;
+
+		if (r->biorq_flags & BIORQ_WRITE) {
+			q = r->biorq_fsrqi;
+			locked = MFH_RLOCK(q->mfsrq_fh);
+			q->mfsrq_flags |= MFSRQ_AIOWAIT;
+			DEBUG_BIORQ(PLL_INFO, r, "aiowait mark, q = %p", q);
+			MFH_URLOCK(q->mfsrq_fh, locked);
+		}
+
 	} else
 		abort();
 
@@ -842,39 +746,73 @@
 }
 
 __static void

-				rc = -EIO;
-				break;
-			}
-			PFL_GOTOERR(out, rc);
-		}
-
 		rc = msl_bmap_lease_tryext(b, NULL, 1);
 		if (rc) {
 			bmap_op_done(b);
@@ -2497,199 +2264,84 @@
 		 * Re-relativize the offset if this request spans more
 		 * than 1 bmap.
 		 */
